mcp-aevo-server 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_aevo_server-0.2.0/LICENSE +21 -0
- mcp_aevo_server-0.2.0/PKG-INFO +153 -0
- mcp_aevo_server-0.2.0/README.md +123 -0
- mcp_aevo_server-0.2.0/pyproject.toml +75 -0
- mcp_aevo_server-0.2.0/setup.cfg +4 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/__init__.py +1 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/client.py +409 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/config.py +114 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/prompts/__init__.py +6 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/prompts/options_prompts.py +325 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/prompts/trader_prompts.py +130 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/resources/__init__.py +5 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/resources/market.py +67 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/server.py +135 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/session_auth.py +113 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/signing.py +304 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/tools/__init__.py +8 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/tools/account.py +512 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/tools/market.py +236 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/tools/order.py +399 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/tools/register.py +127 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/utils/__init__.py +15 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/utils/addressing.py +12 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/utils/rate_limit.py +29 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/utils/response.py +19 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server/utils/validation.py +51 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/PKG-INFO +153 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/SOURCES.txt +39 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/dependency_links.txt +1 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/entry_points.txt +2 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/requires.txt +14 -0
- mcp_aevo_server-0.2.0/src/mcp_aevo_server.egg-info/top_level.txt +1 -0
- mcp_aevo_server-0.2.0/tests/test_client_auth.py +212 -0
- mcp_aevo_server-0.2.0/tests/test_prompts_resources.py +264 -0
- mcp_aevo_server-0.2.0/tests/test_server.py +201 -0
- mcp_aevo_server-0.2.0/tests/test_session_auth.py +34 -0
- mcp_aevo_server-0.2.0/tests/test_tools_account.py +337 -0
- mcp_aevo_server-0.2.0/tests/test_tools_market.py +203 -0
- mcp_aevo_server-0.2.0/tests/test_tools_order.py +184 -0
- mcp_aevo_server-0.2.0/tests/test_tools_registration.py +101 -0
- mcp_aevo_server-0.2.0/tests/test_utils.py +90 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Aevo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-aevo-server
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Model Context Protocol server for AEVO trading
|
|
5
|
+
Author: Aevo
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/aevo-xyz/mcp-aevo-server
|
|
8
|
+
Project-URL: Documentation, https://api-docs.aevo.xyz
|
|
9
|
+
Keywords: mcp,aevo,trading,defi,perpetuals
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: mcp>=1.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.27.0
|
|
19
|
+
Requires-Dist: requests>=2.30.0
|
|
20
|
+
Requires-Dist: eth-account>=0.12.2
|
|
21
|
+
Requires-Dist: eth-utils>=2.3.0
|
|
22
|
+
Provides-Extra: test
|
|
23
|
+
Requires-Dist: pytest>=8.0.0; extra == "test"
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == "test"
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: ruff>=0.8.0; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# AEVO MCP Server
|
|
32
|
+
|
|
33
|
+
MCP server for trading on [AEVO](https://app.aevo.xyz) — works with Claude Code, Claude Desktop, or any MCP client.
|
|
34
|
+
|
|
35
|
+
## Quick Start (Docker + Claude Code)
|
|
36
|
+
|
|
37
|
+
**1. Clone and configure**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/ribbon-finance/aevo-mcp.git
|
|
41
|
+
cd aevo-mcp
|
|
42
|
+
cp .env.example .env
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Edit `.env` with your AEVO credentials (get them from [app.aevo.xyz/settings](https://app.aevo.xyz/settings/api-keys)):
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
AEVO_API_KEY=your_key
|
|
49
|
+
AEVO_API_SECRET=your_secret
|
|
50
|
+
AEVO_SIGNING_KEY_PRIVATE_KEY=your_signing_key
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**2. Start the server**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
docker compose up --build -d
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**3. Connect Claude Code**
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
claude mcp add --transport http aevo-trading http://localhost:8080/mcp
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**4. Test it**
|
|
66
|
+
|
|
67
|
+
Open a new Claude Code session and type:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
call the ping tool
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
You should see `{"ok": true, "result": {"status": "ok"}}`. Try `check my account balance` to verify your credentials work.
|
|
74
|
+
|
|
75
|
+
## Alternative Setup
|
|
76
|
+
|
|
77
|
+
### Local (no Docker)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install -e .
|
|
81
|
+
cp .env.example .env # edit with your credentials
|
|
82
|
+
aevo-mcp --transport stdio
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Then connect Claude Code via stdio:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
claude mcp add --transport stdio aevo-trading -- aevo-mcp --transport stdio
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Claude Desktop
|
|
92
|
+
|
|
93
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
94
|
+
|
|
95
|
+
**With Docker (recommended):**
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"aevo-trading": {
|
|
101
|
+
"type": "http",
|
|
102
|
+
"url": "http://localhost:8080/mcp"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**With local install:**
|
|
109
|
+
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"aevo-trading": {
|
|
114
|
+
"command": "aevo-mcp",
|
|
115
|
+
"args": ["--transport", "stdio"],
|
|
116
|
+
"env": {
|
|
117
|
+
"AEVO_API_KEY": "your_key",
|
|
118
|
+
"AEVO_API_SECRET": "your_secret",
|
|
119
|
+
"AEVO_SIGNING_KEY_PRIVATE_KEY": "your_signing_key"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Environment Variables
|
|
127
|
+
|
|
128
|
+
| Variable | Required | Description |
|
|
129
|
+
|----------|----------|-------------|
|
|
130
|
+
| `AEVO_API_KEY` | Yes* | API key |
|
|
131
|
+
| `AEVO_API_SECRET` | Yes* | API secret |
|
|
132
|
+
| `AEVO_SIGNING_KEY_PRIVATE_KEY` | Yes | Signing key for order submission |
|
|
133
|
+
| `AEVO_ENVIRONMENT` | No | `testnet` or `mainnet` (default) |
|
|
134
|
+
| `AEVO_WALLET_ADDRESS` | No | Wallet address (for `register_account` tool) |
|
|
135
|
+
| `AEVO_WALLET_PRIVATE_KEY` | No | Wallet private key (for `register_account` tool) |
|
|
136
|
+
| `AEVO_AUTO_REGISTER` | No | Auto-register on startup (`true`/`false`) |
|
|
137
|
+
|
|
138
|
+
\* Don't have API keys? Set `AEVO_WALLET_ADDRESS` + `AEVO_WALLET_PRIVATE_KEY` and use the `register_account` tool to generate them. Advise to have a account and use aevo wallet to generate keys.
|
|
139
|
+
|
|
140
|
+
## What's Included
|
|
141
|
+
|
|
142
|
+
**Tools:** `markets`, `account`, `portfolio`, `positions`, `orderbook`, `build_order`, `create_order`, `cancel_order`, `cancel_all`, `register_account`, and more.
|
|
143
|
+
|
|
144
|
+
**Prompts:** `trade_plan`, `risk_checklist`, `cancel_plan`, `onboarding_plan`
|
|
145
|
+
|
|
146
|
+
**Resources:** `aevo://status`, `aevo://markets/summary`, `aevo://account/overview`
|
|
147
|
+
|
|
148
|
+
## Tests
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
pip install -e ".[test]"
|
|
152
|
+
pytest -q tests/
|
|
153
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# AEVO MCP Server
|
|
2
|
+
|
|
3
|
+
MCP server for trading on [AEVO](https://app.aevo.xyz) — works with Claude Code, Claude Desktop, or any MCP client.
|
|
4
|
+
|
|
5
|
+
## Quick Start (Docker + Claude Code)
|
|
6
|
+
|
|
7
|
+
**1. Clone and configure**
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/ribbon-finance/aevo-mcp.git
|
|
11
|
+
cd aevo-mcp
|
|
12
|
+
cp .env.example .env
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Edit `.env` with your AEVO credentials (get them from [app.aevo.xyz/settings](https://app.aevo.xyz/settings/api-keys)):
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
AEVO_API_KEY=your_key
|
|
19
|
+
AEVO_API_SECRET=your_secret
|
|
20
|
+
AEVO_SIGNING_KEY_PRIVATE_KEY=your_signing_key
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**2. Start the server**
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
docker compose up --build -d
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**3. Connect Claude Code**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
claude mcp add --transport http aevo-trading http://localhost:8080/mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**4. Test it**
|
|
36
|
+
|
|
37
|
+
Open a new Claude Code session and type:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
call the ping tool
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You should see `{"ok": true, "result": {"status": "ok"}}`. Try `check my account balance` to verify your credentials work.
|
|
44
|
+
|
|
45
|
+
## Alternative Setup
|
|
46
|
+
|
|
47
|
+
### Local (no Docker)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install -e .
|
|
51
|
+
cp .env.example .env # edit with your credentials
|
|
52
|
+
aevo-mcp --transport stdio
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Then connect Claude Code via stdio:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
claude mcp add --transport stdio aevo-trading -- aevo-mcp --transport stdio
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Claude Desktop
|
|
62
|
+
|
|
63
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
64
|
+
|
|
65
|
+
**With Docker (recommended):**
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"mcpServers": {
|
|
70
|
+
"aevo-trading": {
|
|
71
|
+
"type": "http",
|
|
72
|
+
"url": "http://localhost:8080/mcp"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**With local install:**
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"mcpServers": {
|
|
83
|
+
"aevo-trading": {
|
|
84
|
+
"command": "aevo-mcp",
|
|
85
|
+
"args": ["--transport", "stdio"],
|
|
86
|
+
"env": {
|
|
87
|
+
"AEVO_API_KEY": "your_key",
|
|
88
|
+
"AEVO_API_SECRET": "your_secret",
|
|
89
|
+
"AEVO_SIGNING_KEY_PRIVATE_KEY": "your_signing_key"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Environment Variables
|
|
97
|
+
|
|
98
|
+
| Variable | Required | Description |
|
|
99
|
+
|----------|----------|-------------|
|
|
100
|
+
| `AEVO_API_KEY` | Yes* | API key |
|
|
101
|
+
| `AEVO_API_SECRET` | Yes* | API secret |
|
|
102
|
+
| `AEVO_SIGNING_KEY_PRIVATE_KEY` | Yes | Signing key for order submission |
|
|
103
|
+
| `AEVO_ENVIRONMENT` | No | `testnet` or `mainnet` (default) |
|
|
104
|
+
| `AEVO_WALLET_ADDRESS` | No | Wallet address (for `register_account` tool) |
|
|
105
|
+
| `AEVO_WALLET_PRIVATE_KEY` | No | Wallet private key (for `register_account` tool) |
|
|
106
|
+
| `AEVO_AUTO_REGISTER` | No | Auto-register on startup (`true`/`false`) |
|
|
107
|
+
|
|
108
|
+
\* Don't have API keys? Set `AEVO_WALLET_ADDRESS` + `AEVO_WALLET_PRIVATE_KEY` and use the `register_account` tool to generate them. Advise to have a account and use aevo wallet to generate keys.
|
|
109
|
+
|
|
110
|
+
## What's Included
|
|
111
|
+
|
|
112
|
+
**Tools:** `markets`, `account`, `portfolio`, `positions`, `orderbook`, `build_order`, `create_order`, `cancel_order`, `cancel_all`, `register_account`, and more.
|
|
113
|
+
|
|
114
|
+
**Prompts:** `trade_plan`, `risk_checklist`, `cancel_plan`, `onboarding_plan`
|
|
115
|
+
|
|
116
|
+
**Resources:** `aevo://status`, `aevo://markets/summary`, `aevo://account/overview`
|
|
117
|
+
|
|
118
|
+
## Tests
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
pip install -e ".[test]"
|
|
122
|
+
pytest -q tests/
|
|
123
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "mcp-aevo-server"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Model Context Protocol server for AEVO trading"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [{name = "Aevo"}]
|
|
13
|
+
keywords = ["mcp", "aevo", "trading", "defi", "perpetuals"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Topic :: Office/Business :: Financial :: Investment",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"mcp>=1.0.0",
|
|
22
|
+
"httpx>=0.27.0",
|
|
23
|
+
"requests>=2.30.0",
|
|
24
|
+
"eth-account>=0.12.2",
|
|
25
|
+
"eth-utils>=2.3.0",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/aevo-xyz/mcp-aevo-server"
|
|
30
|
+
Documentation = "https://api-docs.aevo.xyz"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
aevo-mcp = "mcp_aevo_server.server:main"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
test = [
|
|
37
|
+
"pytest>=8.0.0",
|
|
38
|
+
"pytest-asyncio>=0.24.0",
|
|
39
|
+
]
|
|
40
|
+
dev = [
|
|
41
|
+
"ruff>=0.8.0",
|
|
42
|
+
"pytest>=8.0.0",
|
|
43
|
+
"pytest-asyncio>=0.24.0",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
target-version = "py310"
|
|
48
|
+
line-length = 120
|
|
49
|
+
src = ["src", "tests"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint]
|
|
52
|
+
select = [
|
|
53
|
+
"E", # pycodestyle errors
|
|
54
|
+
"W", # pycodestyle warnings
|
|
55
|
+
"F", # pyflakes
|
|
56
|
+
"I", # isort
|
|
57
|
+
"UP", # pyupgrade
|
|
58
|
+
"B", # flake8-bugbear
|
|
59
|
+
"SIM", # flake8-simplify
|
|
60
|
+
"RUF", # ruff-specific rules
|
|
61
|
+
]
|
|
62
|
+
ignore = [
|
|
63
|
+
"E501", # line too long (handled by formatter)
|
|
64
|
+
"SIM108", # ternary operator (readability preference)
|
|
65
|
+
"SIM105", # contextlib.suppress vs try/except/pass (explicit is fine)
|
|
66
|
+
]
|
|
67
|
+
|
|
68
|
+
[tool.ruff.lint.isort]
|
|
69
|
+
known-first-party = ["mcp_aevo_server"]
|
|
70
|
+
|
|
71
|
+
[tool.setuptools]
|
|
72
|
+
package-dir = {"" = "src"}
|
|
73
|
+
|
|
74
|
+
[tool.setuptools.packages.find]
|
|
75
|
+
where = ["src"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Aevo MCP server package."""
|