@ekkos/mcp-server 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 ADDED
@@ -0,0 +1,123 @@
1
+ # @ekkos/mcp-server
2
+
3
+ Stdio-to-SSE bridge for [ekkOS](https://ekkos.dev) Memory substrate. Enables AI tools like Claude Code and Cursor to access your persistent memory via the Model Context Protocol (MCP).
4
+
5
+ ## Quick Start
6
+
7
+ ### Claude Code
8
+
9
+ Add to `~/.claude/settings.json`:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "ekkos-memory": {
15
+ "command": "npx",
16
+ "args": ["-y", "@ekkos/mcp-server"],
17
+ "env": {
18
+ "EKKOS_API_KEY": "your_api_key_here"
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
25
+ ### Cursor
26
+
27
+ Add to `.cursor/mcp.json` in your project:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "ekkos-memory": {
33
+ "command": "npx",
34
+ "args": ["-y", "@ekkos/mcp-server"],
35
+ "env": {
36
+ "EKKOS_API_KEY": "your_api_key_here"
37
+ }
38
+ }
39
+ }
40
+ }
41
+ ```
42
+
43
+ ### Get Your API Key
44
+
45
+ 1. Go to [platform.ekkos.dev](https://platform.ekkos.dev)
46
+ 2. Sign up or log in
47
+ 3. Navigate to **Settings → API Keys**
48
+ 4. Click **"Generate New Key"**
49
+
50
+ ## Environment Variables
51
+
52
+ | Variable | Required | Description |
53
+ |----------|----------|-------------|
54
+ | `EKKOS_API_KEY` | ✅ Yes | Your ekkOS API key from platform.ekkos.dev |
55
+ | `EKKOS_USER_ID` | ❌ No | Your user ID (optional, for better tracking) |
56
+ | `EKKOS_MCP_URL` | ❌ No | Custom MCP gateway URL (default: https://mcp.ekkos.dev/api/v1/mcp/sse) |
57
+ | `EKKOS_DEBUG` | ❌ No | Set to `true` for debug logs |
58
+
59
+ ## How It Works
60
+
61
+ This package creates a bridge between:
62
+ - **Stdio transport** (used by AI tools like Claude Code)
63
+ - **SSE transport** (used by ekkOS cloud memory substrate)
64
+
65
+ When your AI tool starts the MCP server, this bridge:
66
+ 1. Connects to ekkOS cloud via SSE using your API key
67
+ 2. Exposes a stdio interface for your AI tool
68
+ 3. Forwards all MCP messages between stdio and SSE
69
+ 4. Handles authentication, reconnection, and error handling
70
+
71
+ ## Available Memory Tools
72
+
73
+ Once connected, your AI will have access to these ekkOS memory tools:
74
+
75
+ ### The 5 Verbs
76
+ - `ekko` - Search memory for patterns and solutions
77
+ - `crystallize` - Save important decisions permanently
78
+ - `reflex` - Validate suggestions against your history
79
+ - `trace` - Explain why a suggestion was made
80
+ - `consolidate` - Get summary of recent memory activity
81
+
82
+ ### Core Operations
83
+ - `search_memory` - Search across all 10 memory layers
84
+ - `forge_pattern` - Create new patterns from learnings
85
+ - `forge_directive` - Set MUST/NEVER/PREFER/AVOID rules
86
+ - `get_context` - Get relevant context for a task
87
+ - `recall_conversation` - Recall what was discussed at a specific time
88
+ - `search_codebase` - Search project code embeddings
89
+
90
+ ### Golden Loop Tracking
91
+ - `track_application` - Track when memories are applied
92
+ - `record_outcome` - Record if applied memories helped
93
+ - `detect_usage` - Auto-detect pattern usage via semantic similarity
94
+ - `check_conflict` - Check for conflicts with directives
95
+
96
+ [See full MCP tools reference](https://docs.ekkos.dev/api-reference/mcp-tools)
97
+
98
+ ## Troubleshooting
99
+
100
+ ### "EKKOS_API_KEY environment variable is required"
101
+ You need to set your API key in the MCP config. Get one at [platform.ekkos.dev](https://platform.ekkos.dev/dashboard/settings/api-keys).
102
+
103
+ ### MCP server not loading
104
+ 1. Check Node.js version: `node --version` (must be 18+)
105
+ 2. Verify config JSON is valid
106
+ 3. Try running manually: `EKKOS_API_KEY=xxx npx @ekkos/mcp-server`
107
+ 4. Enable debug mode: `EKKOS_DEBUG=true` in env
108
+
109
+ ### Connection errors
110
+ 1. Check your internet connection
111
+ 2. Verify API key is correct and active
112
+ 3. Check https://status.ekkos.dev for service status
113
+
114
+ ## Support
115
+
116
+ - 📚 [Documentation](https://docs.ekkos.dev)
117
+ - 💬 [Discord Community](https://discord.gg/ekkos)
118
+ - 🐛 [Report Issues](https://github.com/ekkos-ai/ekkos/issues)
119
+ - 📧 [Email Support](mailto:support@ekkos.dev)
120
+
121
+ ## License
122
+
123
+ MIT License - see [LICENSE](LICENSE) for details
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @ekkos/mcp-server
4
+ *
5
+ * Simple stdio proxy to ekkOS cloud MCP gateway.
6
+ * This creates a local MCP server that forwards all requests to https://mcp.ekkos.dev
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
package/dist/index.js ADDED
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @ekkos/mcp-server
4
+ *
5
+ * Simple stdio proxy to ekkOS cloud MCP gateway.
6
+ * This creates a local MCP server that forwards all requests to https://mcp.ekkos.dev
7
+ */
8
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
9
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
10
+ import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from '@modelcontextprotocol/sdk/types.js';
11
+ // Configuration
12
+ const EKKOS_API_KEY = process.env.EKKOS_API_KEY || '';
13
+ const EKKOS_USER_ID = process.env.EKKOS_USER_ID || '';
14
+ const EKKOS_MCP_URL = process.env.EKKOS_MCP_URL || 'https://mcp.ekkos.dev/api/v1/mcp';
15
+ const DEBUG = process.env.EKKOS_DEBUG === 'true';
16
+ if (!EKKOS_API_KEY) {
17
+ console.error('[ekkOS] ERROR: EKKOS_API_KEY environment variable is required');
18
+ console.error('[ekkOS] Get your API key at https://platform.ekkos.dev/dashboard/settings/api-keys');
19
+ process.exit(1);
20
+ }
21
+ // Simple HTTP client for MCP gateway
22
+ async function callGateway(endpoint, method, params) {
23
+ const url = `${EKKOS_MCP_URL}/${endpoint}`;
24
+ const headers = {
25
+ 'Content-Type': 'application/json',
26
+ 'Authorization': `Bearer ${EKKOS_API_KEY}`,
27
+ };
28
+ if (EKKOS_USER_ID) {
29
+ headers['X-User-ID'] = EKKOS_USER_ID;
30
+ }
31
+ if (DEBUG) {
32
+ console.error(`[ekkOS] → ${method} ${endpoint}`);
33
+ }
34
+ const response = await fetch(url, {
35
+ method: 'POST',
36
+ headers,
37
+ body: JSON.stringify({ method, params: params || {} }),
38
+ });
39
+ if (!response.ok) {
40
+ throw new Error(`HTTP ${response.status}: ${response.statusText}`);
41
+ }
42
+ const data = await response.json();
43
+ if (DEBUG) {
44
+ console.error(`[ekkOS] ← ${method} OK`);
45
+ }
46
+ return data;
47
+ }
48
+ // Create MCP server
49
+ const server = new Server({
50
+ name: 'ekkos-memory',
51
+ version: '1.0.0',
52
+ }, {
53
+ capabilities: {
54
+ tools: {},
55
+ resources: {},
56
+ prompts: {},
57
+ },
58
+ });
59
+ // List tools - proxy to gateway
60
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
61
+ const result = await callGateway('tools/list', 'tools/list');
62
+ return result;
63
+ });
64
+ // Call tool - proxy to gateway
65
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
66
+ const result = await callGateway('tools/call', 'tools/call', {
67
+ name: request.params.name,
68
+ arguments: request.params.arguments,
69
+ });
70
+ return result;
71
+ });
72
+ // List resources - proxy to gateway
73
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
74
+ const result = await callGateway('resources/list', 'resources/list');
75
+ return result;
76
+ });
77
+ // Read resource - proxy to gateway
78
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
79
+ const result = await callGateway('resources/read', 'resources/read', {
80
+ uri: request.params.uri,
81
+ });
82
+ return result;
83
+ });
84
+ // List prompts - proxy to gateway
85
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
86
+ const result = await callGateway('prompts/list', 'prompts/list');
87
+ return result;
88
+ });
89
+ // Get prompt - proxy to gateway
90
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
91
+ const result = await callGateway('prompts/get', 'prompts/get', {
92
+ name: request.params.name,
93
+ arguments: request.params.arguments,
94
+ });
95
+ return result;
96
+ });
97
+ // Error handling
98
+ server.onerror = (error) => {
99
+ console.error('[ekkOS] Server error:', error);
100
+ };
101
+ process.on('SIGINT', async () => {
102
+ if (DEBUG) {
103
+ console.error('[ekkOS] Shutting down...');
104
+ }
105
+ await server.close();
106
+ process.exit(0);
107
+ });
108
+ // Start server
109
+ async function main() {
110
+ if (DEBUG) {
111
+ console.error('[ekkOS] Starting MCP proxy to ekkOS Memory...');
112
+ console.error(`[ekkOS] Gateway: ${EKKOS_MCP_URL}`);
113
+ console.error(`[ekkOS] User ID: ${EKKOS_USER_ID || '(not set)'}`);
114
+ }
115
+ const transport = new StdioServerTransport();
116
+ await server.connect(transport);
117
+ if (DEBUG) {
118
+ console.error('[ekkOS] ✓ Ready! Your AI can now access ekkOS memory.');
119
+ }
120
+ }
121
+ main().catch((error) => {
122
+ console.error('[ekkOS] Fatal error:', error);
123
+ process.exit(1);
124
+ });
125
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAE5C,gBAAgB;AAChB,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAA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AC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAC/D,OAAO,CAAC,KAAK,CAAC,oBAAoB,aAAa,EAAE,CAAC,CAAC;QACnD,OAAO,CAAC,KAAK,CAAC,oBAAoB,aAAa,IAAI,WAAW,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;IAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@ekkos/mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "ekkOS Memory MCP Server - stdio bridge to cloud memory substrate",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "bin": {
8
+ "ekkos-mcp-server": "dist/index.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "keywords": [
16
+ "ekkos",
17
+ "mcp",
18
+ "memory",
19
+ "ai",
20
+ "claude",
21
+ "anthropic",
22
+ "model-context-protocol"
23
+ ],
24
+ "author": "ekkOS",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/ekkos-ai/ekkos.git",
29
+ "directory": "packages/ekkos-mcp-server"
30
+ },
31
+ "dependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.0.4"
33
+ },
34
+ "devDependencies": {
35
+ "@types/node": "^20.11.5",
36
+ "typescript": "^5.3.3"
37
+ },
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ }
41
+ }