Skip to content

Commit ffde27b

Browse files
committed
Initial release: Interactive Brokers TWS MCP Server
A comprehensive MCP server for Claude Desktop that interfaces with Interactive Brokers TWS API. Features: - Portfolio management with detailed position tracking - Enhanced options trading with comprehensive Greeks support - Real-time market data and quotes - Order placement and management - Rate limiting and security controls - Comprehensive option position details (strikes, expiration, Greeks) - Portfolio-level and underlying-level Greeks aggregation Security: - Input validation and sanitization - Rate limiting (40 req/sec) - Order size limits and safety controls - Local connections only (127.0.0.1) - Proper error handling and cleanup License: Public Domain / Unlicense - No copyright restrictions - Free for any use, modification, distribution - No attribution required ⚠️ Trading Disclaimer: This is educational/testing software. Use at your own risk. Always test with paper trading first.
0 parents  commit ffde27b

20 files changed

+6990
-0
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x, 22.x]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Check TypeScript
32+
run: npx tsc --noEmit
33+
34+
security:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Run npm audit
40+
run: npm audit --production
41+
continue-on-error: true

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
node_modules/
2+
dist/
3+
*.log
4+
.env
5+
.env.local
6+
.DS_Store
7+
*.swp
8+
*.swo
9+
*~
10+
.idea/
11+
.vscode/
12+
*.iml
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
.npm
17+
*.tgz
18+
19+
# Test files
20+
test-*.ts
21+
test-*.js
22+
23+
# Build files
24+
*.js.map
25+
*.d.ts.map
26+
27+
# OS files
28+
Thumbs.db
29+
30+
# Editor directories
31+
.sublime-*
32+
.atom/
33+
*.code-workspace

CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Contributing to IB TWS MCP Server
2+
3+
Thank you for your interest in contributing to the Interactive Brokers TWS MCP Server! This document provides guidelines for contributing to the project.
4+
5+
## How to Contribute
6+
7+
### Reporting Issues
8+
9+
- Use the GitHub issue tracker to report bugs
10+
- Describe the issue clearly, including steps to reproduce
11+
- Include your environment details (OS, Node.js version, TWS version)
12+
13+
### Submitting Pull Requests
14+
15+
1. Fork the repository
16+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
17+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
18+
4. Push to the branch (`git push origin feature/amazing-feature`)
19+
5. Open a Pull Request
20+
21+
### Code Style
22+
23+
- Use TypeScript for all new code
24+
- Follow the existing code style
25+
- Add appropriate type definitions
26+
- Include comments for complex logic
27+
- Run the linter before submitting
28+
29+
### Testing
30+
31+
- Test your changes with both paper trading and live accounts (carefully!)
32+
- Ensure all existing functionality still works
33+
- Add tests for new features when possible
34+
35+
### Commit Messages
36+
37+
- Use clear and descriptive commit messages
38+
- Start with a verb in present tense (e.g., "Add", "Fix", "Update")
39+
- Reference issue numbers when applicable
40+
41+
## Development Setup
42+
43+
1. Clone the repository
44+
2. Install dependencies: `npm install`
45+
3. Build the project: `npm run build`
46+
4. Test with Claude Desktop
47+
48+
## Safety Guidelines
49+
50+
- **Never commit API credentials or account information**
51+
- Always test with paper trading accounts first
52+
- Be extremely careful with order placement functionality
53+
- Include appropriate warnings in documentation
54+
55+
## Questions?
56+
57+
Feel free to open an issue for any questions about contributing.
58+
59+
Thank you for helping make this project better!

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>

0 commit comments

Comments
 (0)