heady-mcp-server 3.2.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,41 @@
1
+ # @heady/mcp-server
2
+
3
+ > Model Context Protocol (MCP) server for the Heady™ AI Platform — tool registration, memory operations, and JSON-RPC 2.0 handling.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @heady/mcp-server
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```ts
14
+ import { MCPServer } from '@heady/mcp-server';
15
+
16
+ const server = new MCPServer();
17
+
18
+ // Handle an MCP request
19
+ const response = await server.handleRequest({
20
+ jsonrpc: '2.0',
21
+ id: 1,
22
+ method: 'tools/call',
23
+ params: {
24
+ name: 'memory.store',
25
+ arguments: { userId: 'user-1', x: 0, y: 0, z: 0, embedding: [1,2,3], metadata: {} }
26
+ }
27
+ });
28
+ ```
29
+
30
+ ## Built-in Tools
31
+
32
+ | Tool | Description |
33
+ |------|-------------|
34
+ | `memory.store` | Store a 3D vector memory |
35
+ | `memory.query` | Cosine-similarity search |
36
+ | `memory.stats` | User memory statistics |
37
+ | `server.health` | Server health check |
38
+
39
+ ## License
40
+
41
+ Proprietary — © 2026 HeadySystems Inc.
@@ -0,0 +1,24 @@
1
+ export interface MCPRequest {
2
+ jsonrpc: '2.0';
3
+ id: string | number;
4
+ method: string;
5
+ params?: any;
6
+ }
7
+ export interface MCPResponse {
8
+ jsonrpc: '2.0';
9
+ id: string | number;
10
+ result?: any;
11
+ error?: {
12
+ code: number;
13
+ message: string;
14
+ };
15
+ }
16
+ export declare class MCPServer {
17
+ private memoryStore;
18
+ private tools;
19
+ private startTime;
20
+ constructor();
21
+ private registerTools;
22
+ handleRequest(request: MCPRequest): Promise<MCPResponse>;
23
+ }
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,SAAS,CAAc;;IAM/B,OAAO,CAAC,aAAa;IA8Bf,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;CA6C/D"}
package/dist/index.js ADDED
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MCPServer = void 0;
4
+ const vector_memory_1 = require("@heady/vector-memory");
5
+ class MCPServer {
6
+ memoryStore = new vector_memory_1.VectorMemoryStore();
7
+ tools = new Map();
8
+ startTime = Date.now();
9
+ constructor() {
10
+ this.registerTools();
11
+ }
12
+ registerTools() {
13
+ this.tools.set('memory.store', (params) => {
14
+ const { userId, x, y, z, embedding, metadata } = params;
15
+ const memory = { x, y, z, embedding, metadata, timestamp: Date.now() };
16
+ this.memoryStore.store(userId, memory);
17
+ return { success: true, timestamp: memory.timestamp };
18
+ });
19
+ this.tools.set('memory.query', (params) => {
20
+ const { userId, embedding, limit } = params;
21
+ const results = this.memoryStore.query(userId, embedding, limit);
22
+ return { results, count: results.length };
23
+ });
24
+ this.tools.set('memory.stats', (params) => {
25
+ const { userId } = params;
26
+ return this.memoryStore.getStats(userId);
27
+ });
28
+ this.tools.set('server.health', () => {
29
+ const uptimeMs = Date.now() - this.startTime;
30
+ return {
31
+ status: 'healthy',
32
+ version: '3.2.0',
33
+ uptime: uptimeMs / 1000,
34
+ timestamp: Date.now()
35
+ };
36
+ });
37
+ }
38
+ async handleRequest(request) {
39
+ if (request.method === 'tools/list') {
40
+ return {
41
+ jsonrpc: '2.0',
42
+ id: request.id,
43
+ result: {
44
+ tools: Array.from(this.tools.keys()).map(name => ({
45
+ name,
46
+ description: `Tool: ${name}`,
47
+ inputSchema: { type: 'object' }
48
+ }))
49
+ }
50
+ };
51
+ }
52
+ if (request.method === 'tools/call') {
53
+ const { name, arguments: args } = request.params;
54
+ const tool = this.tools.get(name);
55
+ if (!tool) {
56
+ return {
57
+ jsonrpc: '2.0',
58
+ id: request.id,
59
+ error: { code: -32601, message: `Tool not found: ${name}` }
60
+ };
61
+ }
62
+ try {
63
+ const result = await tool(args);
64
+ return { jsonrpc: '2.0', id: request.id, result };
65
+ }
66
+ catch (error) {
67
+ return {
68
+ jsonrpc: '2.0',
69
+ id: request.id,
70
+ error: { code: -32603, message: error.message }
71
+ };
72
+ }
73
+ }
74
+ return {
75
+ jsonrpc: '2.0',
76
+ id: request.id,
77
+ error: { code: -32601, message: 'Method not found' }
78
+ };
79
+ }
80
+ }
81
+ exports.MCPServer = MCPServer;
82
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wDAAmE;AAgBnE,MAAa,SAAS;IACZ,WAAW,GAAG,IAAI,iCAAiB,EAAE,CAAC;IACtC,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IACpC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE/B;QACE,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,MAAW,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,EAAE,CAAC;gBACpB,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,EAAE,EAAE,OAAO,CAAC,EAAE;oBACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;iBAChD,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,KAAK;YACd,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE;SACrD,CAAC;IACJ,CAAC;CACF;AApFD,8BAoFC"}
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "heady-mcp-server",
3
+ "version": "3.2.0",
4
+ "description": "Model Context Protocol (MCP) server implementation for the Heady AI Platform — tool registration, memory operations, and JSON-RPC handling.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "require": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist/",
15
+ "README.md"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "clean": "rm -rf dist",
20
+ "prepublishOnly": "npm run clean && npm run build"
21
+ },
22
+ "dependencies": {
23
+ "heady-core": "^3.2.0",
24
+ "heady-vector-memory": "^3.2.0"
25
+ },
26
+ "license": "UNLICENSED",
27
+ "author": {
28
+ "name": "HeadySystems Inc.",
29
+ "email": "eric@headyconnection.org",
30
+ "url": "https://headyme.com"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/HeadyMe/heady-production.git",
35
+ "directory": "packages/mcp-server"
36
+ },
37
+ "homepage": "https://headysystems.com",
38
+ "bugs": {
39
+ "url": "https://github.com/HeadyMe/heady-production/issues"
40
+ },
41
+ "keywords": [
42
+ "heady",
43
+ "ai",
44
+ "mcp",
45
+ "model-context-protocol",
46
+ "json-rpc",
47
+ "tools",
48
+ "multi-agent"
49
+ ],
50
+ "engines": {
51
+ "node": ">=20.0.0"
52
+ }
53
+ }