@everstateai/mcp 1.0.0
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 +52 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
- package/src/index.ts +104 -0
- package/tsconfig.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# @everstate/mcp-proxy
|
|
2
|
+
|
|
3
|
+
Thin MCP proxy for Everstate. All business logic lives in the cloud.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @everstate/mcp-proxy
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"mcpServers": {
|
|
18
|
+
"everstate": {
|
|
19
|
+
"command": "everstate-mcp",
|
|
20
|
+
"env": {
|
|
21
|
+
"EVERSTATE_API_KEY": "your_api_key_here"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Environment Variables
|
|
29
|
+
|
|
30
|
+
| Variable | Required | Description |
|
|
31
|
+
|----------|----------|-------------|
|
|
32
|
+
| `EVERSTATE_API_KEY` | Yes | Your Everstate API key |
|
|
33
|
+
| `EVERSTATE_PROJECT_ID` | No | Default project ID for all calls |
|
|
34
|
+
| `EVERSTATE_API_URL` | No | API base URL (default: `https://www.everstate.ai`) |
|
|
35
|
+
| `EVERSTATE_MODE` | No | Tool mode: `core`, `meta`, or `extended` |
|
|
36
|
+
|
|
37
|
+
## How It Works
|
|
38
|
+
|
|
39
|
+
This proxy is intentionally minimal (~50 lines). It:
|
|
40
|
+
|
|
41
|
+
1. Fetches tool definitions from the Everstate API
|
|
42
|
+
2. Forwards tool calls to the Everstate API
|
|
43
|
+
3. Returns responses to Claude
|
|
44
|
+
|
|
45
|
+
All business logic, tool schemas, and data operations live server-side. You get:
|
|
46
|
+
- Instant updates (no npm updates needed)
|
|
47
|
+
- Feature gating by API key tier
|
|
48
|
+
- Full security and metering server-side
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Everstate MCP Proxy
|
|
4
|
+
*
|
|
5
|
+
* A thin proxy that forwards MCP calls to the Everstate cloud API.
|
|
6
|
+
* All business logic, tool definitions, and data operations live server-side.
|
|
7
|
+
*
|
|
8
|
+
* This file is intentionally minimal (~50 lines of actual logic).
|
|
9
|
+
* Users see nothing proprietary - just HTTP forwarding.
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Everstate MCP Proxy
|
|
5
|
+
*
|
|
6
|
+
* A thin proxy that forwards MCP calls to the Everstate cloud API.
|
|
7
|
+
* All business logic, tool definitions, and data operations live server-side.
|
|
8
|
+
*
|
|
9
|
+
* This file is intentionally minimal (~50 lines of actual logic).
|
|
10
|
+
* Users see nothing proprietary - just HTTP forwarding.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
14
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
15
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
16
|
+
const API_BASE = process.env.EVERSTATE_API_URL || "https://www.everstate.ai";
|
|
17
|
+
const API_KEY = process.env.EVERSTATE_API_KEY;
|
|
18
|
+
const PROJECT_ID = process.env.EVERSTATE_PROJECT_ID;
|
|
19
|
+
if (!API_KEY) {
|
|
20
|
+
console.error("EVERSTATE_API_KEY environment variable is required");
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
// Create MCP server
|
|
24
|
+
const server = new index_js_1.Server({ name: "everstate", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
25
|
+
// Fetch tool definitions from cloud
|
|
26
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
27
|
+
const res = await fetch(`${API_BASE}/mcp/tools`, {
|
|
28
|
+
method: "POST",
|
|
29
|
+
headers: {
|
|
30
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
31
|
+
"Content-Type": "application/json",
|
|
32
|
+
},
|
|
33
|
+
body: JSON.stringify({ mode: process.env.EVERSTATE_MODE }),
|
|
34
|
+
});
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new Error(`Failed to fetch tools: ${res.status} ${res.statusText}`);
|
|
37
|
+
}
|
|
38
|
+
const data = (await res.json());
|
|
39
|
+
return { tools: data.tools };
|
|
40
|
+
});
|
|
41
|
+
// Forward tool calls to cloud
|
|
42
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
43
|
+
const { name, arguments: args } = request.params;
|
|
44
|
+
// Inject default projectId if not provided and we have one configured
|
|
45
|
+
// For meta-tool (everstate), projectId may be in params.projectId
|
|
46
|
+
const enrichedArgs = { ...args };
|
|
47
|
+
const params = enrichedArgs.params;
|
|
48
|
+
const hasProjectIdInParams = params && typeof params === 'object' && 'projectId' in params && params.projectId;
|
|
49
|
+
if (PROJECT_ID && !enrichedArgs.projectId && !hasProjectIdInParams) {
|
|
50
|
+
enrichedArgs.projectId = PROJECT_ID;
|
|
51
|
+
}
|
|
52
|
+
const res = await fetch(`${API_BASE}/mcp/execute`, {
|
|
53
|
+
method: "POST",
|
|
54
|
+
headers: {
|
|
55
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
56
|
+
"Content-Type": "application/json",
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify({ name, arguments: enrichedArgs }),
|
|
59
|
+
});
|
|
60
|
+
if (!res.ok) {
|
|
61
|
+
return {
|
|
62
|
+
content: [{ type: "text", text: `API error: ${res.status} ${res.statusText}` }],
|
|
63
|
+
isError: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return (await res.json());
|
|
67
|
+
});
|
|
68
|
+
// Start server
|
|
69
|
+
async function main() {
|
|
70
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
71
|
+
await server.connect(transport);
|
|
72
|
+
console.error("Everstate MCP Proxy connected to", API_BASE);
|
|
73
|
+
}
|
|
74
|
+
main().catch((error) => {
|
|
75
|
+
console.error("Fatal error:", error);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;GAQG;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAM4C;AAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,0BAA0B,CAAC;AAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;AAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;AAEpD,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACpE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,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@everstateai/mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Everstate MCP server - persistent AI coding memory",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"everstate-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"dev": "ts-node src/index.ts"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"everstate",
|
|
18
|
+
"claude",
|
|
19
|
+
"ai",
|
|
20
|
+
"memory",
|
|
21
|
+
"context"
|
|
22
|
+
],
|
|
23
|
+
"author": "Everstate.ai",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/rshambaugh/everstate"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.0.0",
|
|
34
|
+
"typescript": "^5.0.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0"
|
|
38
|
+
},
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Everstate MCP Proxy
|
|
4
|
+
*
|
|
5
|
+
* A thin proxy that forwards MCP calls to the Everstate cloud API.
|
|
6
|
+
* All business logic, tool definitions, and data operations live server-side.
|
|
7
|
+
*
|
|
8
|
+
* This file is intentionally minimal (~50 lines of actual logic).
|
|
9
|
+
* Users see nothing proprietary - just HTTP forwarding.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
13
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
|
+
import {
|
|
15
|
+
CallToolRequestSchema,
|
|
16
|
+
ListToolsRequestSchema,
|
|
17
|
+
CallToolResult,
|
|
18
|
+
ListToolsResult,
|
|
19
|
+
Tool,
|
|
20
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
21
|
+
|
|
22
|
+
const API_BASE = process.env.EVERSTATE_API_URL || "https://www.everstate.ai";
|
|
23
|
+
const API_KEY = process.env.EVERSTATE_API_KEY;
|
|
24
|
+
const PROJECT_ID = process.env.EVERSTATE_PROJECT_ID;
|
|
25
|
+
|
|
26
|
+
if (!API_KEY) {
|
|
27
|
+
console.error("EVERSTATE_API_KEY environment variable is required");
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Type for API responses
|
|
32
|
+
interface ToolsResponse {
|
|
33
|
+
tools: Tool[];
|
|
34
|
+
meta?: { tier: string; mode: string; totalTools: number };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Create MCP server
|
|
38
|
+
const server = new Server(
|
|
39
|
+
{ name: "everstate", version: "1.0.0" },
|
|
40
|
+
{ capabilities: { tools: {} } }
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
// Fetch tool definitions from cloud
|
|
44
|
+
server.setRequestHandler(ListToolsRequestSchema, async (): Promise<ListToolsResult> => {
|
|
45
|
+
const res = await fetch(`${API_BASE}/mcp/tools`, {
|
|
46
|
+
method: "POST",
|
|
47
|
+
headers: {
|
|
48
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
49
|
+
"Content-Type": "application/json",
|
|
50
|
+
},
|
|
51
|
+
body: JSON.stringify({ mode: process.env.EVERSTATE_MODE }),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!res.ok) {
|
|
55
|
+
throw new Error(`Failed to fetch tools: ${res.status} ${res.statusText}`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const data = (await res.json()) as ToolsResponse;
|
|
59
|
+
return { tools: data.tools };
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Forward tool calls to cloud
|
|
63
|
+
server.setRequestHandler(CallToolRequestSchema, async (request): Promise<CallToolResult> => {
|
|
64
|
+
const { name, arguments: args } = request.params;
|
|
65
|
+
|
|
66
|
+
// Inject default projectId if not provided and we have one configured
|
|
67
|
+
// For meta-tool (everstate), projectId may be in params.projectId
|
|
68
|
+
const enrichedArgs = { ...args } as Record<string, unknown>;
|
|
69
|
+
const params = enrichedArgs.params as Record<string, unknown> | undefined;
|
|
70
|
+
const hasProjectIdInParams = params && typeof params === 'object' && 'projectId' in params && params.projectId;
|
|
71
|
+
if (PROJECT_ID && !enrichedArgs.projectId && !hasProjectIdInParams) {
|
|
72
|
+
enrichedArgs.projectId = PROJECT_ID;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const res = await fetch(`${API_BASE}/mcp/execute`, {
|
|
76
|
+
method: "POST",
|
|
77
|
+
headers: {
|
|
78
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
79
|
+
"Content-Type": "application/json",
|
|
80
|
+
},
|
|
81
|
+
body: JSON.stringify({ name, arguments: enrichedArgs }),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (!res.ok) {
|
|
85
|
+
return {
|
|
86
|
+
content: [{ type: "text", text: `API error: ${res.status} ${res.statusText}` }],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return (await res.json()) as CallToolResult;
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Start server
|
|
95
|
+
async function main() {
|
|
96
|
+
const transport = new StdioServerTransport();
|
|
97
|
+
await server.connect(transport);
|
|
98
|
+
console.error("Everstate MCP Proxy connected to", API_BASE);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
main().catch((error) => {
|
|
102
|
+
console.error("Fatal error:", error);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
"sourceMap": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|