@robosystems/mcp 0.2.7 → 0.2.9
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.
- package/README.md +11 -108
- package/index.js +13 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@robosystems/mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
Official MCP (Model Context Protocol) client adapter for connecting AI agents to RoboSystems Financial Knowledge Graph API. Access comprehensive financial data including accounting transactions, financial reports, and advanced graph analytics through the Model Context Protocol.
|
|
6
|
+
Official MCP (Model Context Protocol) client adapter for connecting AI agents to the RoboSystems Financial Knowledge Graph API. Access comprehensive financial data including accounting transactions, financial reports, and advanced graph analytics through the Model Context Protocol.
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
@@ -14,21 +14,9 @@ Official MCP (Model Context Protocol) client adapter for connecting AI agents to
|
|
|
14
14
|
- **Automatic retry logic** with exponential backoff
|
|
15
15
|
- **Real-time progress tracking** for long-running operations
|
|
16
16
|
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install @robosystems/mcp
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Or run directly with npx:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx @robosystems/mcp
|
|
27
|
-
```
|
|
28
|
-
|
|
29
17
|
## Quick Start
|
|
30
18
|
|
|
31
|
-
Add to your
|
|
19
|
+
Add to your MCP servers configuration:
|
|
32
20
|
|
|
33
21
|
```json
|
|
34
22
|
{
|
|
@@ -38,8 +26,8 @@ Add to your Claude Desktop configuration:
|
|
|
38
26
|
"args": ["-y", "@robosystems/mcp"],
|
|
39
27
|
"env": {
|
|
40
28
|
"ROBOSYSTEMS_API_URL": "https://api.robosystems.ai",
|
|
41
|
-
"ROBOSYSTEMS_API_KEY": "
|
|
42
|
-
"ROBOSYSTEMS_GRAPH_ID": "
|
|
29
|
+
"ROBOSYSTEMS_API_KEY": "rfs...",
|
|
30
|
+
"ROBOSYSTEMS_GRAPH_ID": "kg..."
|
|
43
31
|
}
|
|
44
32
|
}
|
|
45
33
|
}
|
|
@@ -48,101 +36,16 @@ Add to your Claude Desktop configuration:
|
|
|
48
36
|
|
|
49
37
|
## Environment Variables
|
|
50
38
|
|
|
51
|
-
| Variable | Description |
|
|
39
|
+
| Variable | Description | Example |
|
|
52
40
|
|----------|-------------|---------|
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
|
|
57
|
-
## Configuration Details
|
|
58
|
-
|
|
59
|
-
### Connection Pooling
|
|
60
|
-
- **Maximum Connections**: 5 concurrent SSE connections (hardcoded)
|
|
61
|
-
- **Connection TTL**: 30 seconds before automatic cleanup
|
|
62
|
-
- Connections are reused across requests for better performance
|
|
63
|
-
|
|
64
|
-
### Smart Caching
|
|
65
|
-
Cache TTL values per tool type:
|
|
66
|
-
- **`get-graph-schema`**: 1 hour (3600 seconds)
|
|
67
|
-
- **`get-graph-info`**: 5 minutes (300 seconds)
|
|
68
|
-
- **`describe-graph-structure`**: 30 minutes (1800 seconds)
|
|
69
|
-
- **Other tools**: 5 minutes (300 seconds) default
|
|
70
|
-
|
|
71
|
-
### Timeouts
|
|
72
|
-
- **SSE Timeout**: 5 minutes for streaming operations
|
|
73
|
-
- **Metrics Logging**: Every 5 minutes
|
|
74
|
-
|
|
75
|
-
## Available Tools
|
|
76
|
-
|
|
77
|
-
### Core Query Tools
|
|
78
|
-
- **`read-graph-cypher`**: Execute read-only Cypher queries on the graph database
|
|
79
|
-
- Supports streaming for large result sets
|
|
80
|
-
- Automatic result aggregation
|
|
81
|
-
- Progress tracking for complex queries
|
|
82
|
-
|
|
83
|
-
### Schema & Information Tools
|
|
84
|
-
- **`get-graph-schema`**: Retrieve the complete database schema
|
|
85
|
-
- Returns node types and relationship definitions
|
|
86
|
-
|
|
87
|
-
- **`get-graph-info`**: Get basic information about the graph
|
|
88
|
-
- Includes node counts, relationship counts, and metadata
|
|
89
|
-
|
|
90
|
-
- **`describe-graph-structure`**: Get natural language description of the graph
|
|
91
|
-
- AI-friendly format for better understanding
|
|
92
|
-
|
|
93
|
-
## Technical Details
|
|
94
|
-
|
|
95
|
-
### Response Formats
|
|
96
|
-
The MCP server automatically handles multiple response formats:
|
|
97
|
-
- **JSON**: Standard synchronous responses
|
|
98
|
-
- **SSE (Server-Sent Events)**: Real-time streaming for long operations
|
|
99
|
-
- **NDJSON**: Newline-delimited JSON for batch processing
|
|
100
|
-
- **Queued**: Queued operations with status polling
|
|
101
|
-
|
|
102
|
-
## Integration Examples
|
|
103
|
-
|
|
104
|
-
### Claude Desktop
|
|
105
|
-
```json
|
|
106
|
-
{
|
|
107
|
-
"mcpServers": {
|
|
108
|
-
"robosystems": {
|
|
109
|
-
"command": "npx",
|
|
110
|
-
"args": ["-y", "@robosystems/mcp"],
|
|
111
|
-
"env": {
|
|
112
|
-
"ROBOSYSTEMS_API_URL": "https://api.robosystems.ai",
|
|
113
|
-
"ROBOSYSTEMS_API_KEY": "your-api-key-here",
|
|
114
|
-
"ROBOSYSTEMS_GRAPH_ID": "your-graph-id"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Local Development
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"mcpServers": {
|
|
125
|
-
"robosystems-local": {
|
|
126
|
-
"command": "npx",
|
|
127
|
-
"args": ["-y", "@robosystems/mcp"],
|
|
128
|
-
"env": {
|
|
129
|
-
"ROBOSYSTEMS_API_URL": "http://localhost:8000",
|
|
130
|
-
"ROBOSYSTEMS_API_KEY": "your-api-dev-key-here",
|
|
131
|
-
"ROBOSYSTEMS_GRAPH_ID": "your-dev-graph-id"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Usage Examples
|
|
41
|
+
| `ROBOSYSTEMS_API_KEY` | Your API key | `rfs...` |
|
|
42
|
+
| `ROBOSYSTEMS_GRAPH_ID` | The graph database ID to connect to | `kg...` or `sec` |
|
|
43
|
+
| `ROBOSYSTEMS_API_URL` | The RoboSystems API endpoint | `https://api.robosystems.ai` |
|
|
139
44
|
|
|
140
|
-
|
|
45
|
+
## MCP API Reference
|
|
141
46
|
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
- **Explore relationships**: "How are companies connected to their financial reports?"
|
|
145
|
-
- **Run complex analyses**: "Find companies with revenue growth over 20% in the last year"
|
|
47
|
+
- MCP API documentation: [https://api.robosystems.ai/docs#tag/MCP](https://api.robosystems.ai/docs#tag/MCP)
|
|
48
|
+
- RoboSystems: [https://robosystems.ai](https://robosystems.ai)
|
|
146
49
|
|
|
147
50
|
## Support
|
|
148
51
|
|
package/index.js
CHANGED
|
@@ -196,9 +196,9 @@ class RoboSystemsMCPClient {
|
|
|
196
196
|
|
|
197
197
|
async getTools() {
|
|
198
198
|
try {
|
|
199
|
-
console.error(`Fetching tools from ${this.baseUrl}/v1/
|
|
199
|
+
console.error(`Fetching tools from ${this.baseUrl}/v1/graphs/${this.graphId}/mcp/tools`)
|
|
200
200
|
const response = await fetch(
|
|
201
|
-
`${this.baseUrl}/v1/
|
|
201
|
+
`${this.baseUrl}/v1/graphs/${this.graphId}/mcp/tools`,
|
|
202
202
|
{
|
|
203
203
|
headers: this.headers,
|
|
204
204
|
}
|
|
@@ -244,7 +244,7 @@ class RoboSystemsMCPClient {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
const response = await fetch(
|
|
247
|
-
`${this.baseUrl}/v1/
|
|
247
|
+
`${this.baseUrl}/v1/graphs/${this.graphId}/mcp/call-tool`,
|
|
248
248
|
{
|
|
249
249
|
method: 'POST',
|
|
250
250
|
headers,
|
|
@@ -468,9 +468,9 @@ class RoboSystemsMCPClient {
|
|
|
468
468
|
console.error(`Query queued with ID: ${data.queue_id}`)
|
|
469
469
|
|
|
470
470
|
const statusUrl = data.status_url ||
|
|
471
|
-
`${this.baseUrl}/v1/
|
|
471
|
+
`${this.baseUrl}/v1/graphs/${this.graphId}/query/${data.queue_id}/status`
|
|
472
472
|
const resultUrl = data.result_url ||
|
|
473
|
-
`${this.baseUrl}/v1/
|
|
473
|
+
`${this.baseUrl}/v1/graphs/${this.graphId}/query/${data.queue_id}/result`
|
|
474
474
|
|
|
475
475
|
// Simple polling with exponential backoff
|
|
476
476
|
let attempts = 0
|
|
@@ -624,9 +624,9 @@ class RoboSystemsMCPClient {
|
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
async function main() {
|
|
627
|
-
const baseUrl = process.env.ROBOSYSTEMS_API_URL || '
|
|
627
|
+
const baseUrl = process.env.ROBOSYSTEMS_API_URL || 'https://api.robosystems.ai'
|
|
628
628
|
const apiKey = process.env.ROBOSYSTEMS_API_KEY
|
|
629
|
-
const graphId = process.env.ROBOSYSTEMS_GRAPH_ID
|
|
629
|
+
const graphId = process.env.ROBOSYSTEMS_GRAPH_ID
|
|
630
630
|
|
|
631
631
|
if (!apiKey) {
|
|
632
632
|
console.error('ROBOSYSTEMS_API_KEY environment variable is required')
|
|
@@ -634,6 +634,12 @@ async function main() {
|
|
|
634
634
|
process.exit(1)
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
+
if (!graphId) {
|
|
638
|
+
console.error('ROBOSYSTEMS_GRAPH_ID environment variable is required')
|
|
639
|
+
console.error('Please set ROBOSYSTEMS_GRAPH_ID in your MCP configuration')
|
|
640
|
+
process.exit(1)
|
|
641
|
+
}
|
|
642
|
+
|
|
637
643
|
console.error(`RoboSystems MCP Client v${PACKAGE_VERSION}`)
|
|
638
644
|
console.error(`Connecting to ${baseUrl} for graph ${graphId}`)
|
|
639
645
|
console.error(`API Key: ${apiKey.substring(0, 10)}...`)
|