geo-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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Riccardo Esclapon
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.
package/README.md ADDED
@@ -0,0 +1,131 @@
1
+ # Geo MCP Server
2
+
3
+ MCP server providing full access to the [Geo protocol](https://geo.xyz) SDK for knowledge graph operations. Build, query, and publish structured knowledge to the Geo decentralized knowledge network using the [GRC-20](https://github.com/geobrowser/grcs/blob/main/grcs/grc-0020.md) standard.
4
+
5
+ ## Features
6
+
7
+ - **19 tools** covering the full Geo SDK surface
8
+ - **Session-based op accumulation** - build complex edits across multiple tool calls, then publish as a single atomic transaction
9
+ - **Name-based resolution** - reference properties, types, and entities by name instead of IDs
10
+ - **Gas-sponsored smart accounts** - no testnet ETH needed (uses Pimlico paymaster)
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install
16
+ npm run build
17
+ ```
18
+
19
+ ## Configuration
20
+
21
+ Add to your MCP client config (e.g. Claude Code `.mcp.json`):
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "geo": {
27
+ "command": "node",
28
+ "args": ["/path/to/geo-mcp-server/dist/index.js"],
29
+ "env": {
30
+ "GEO_PRIVATE_KEY": "0x..."
31
+ }
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ The `GEO_PRIVATE_KEY` environment variable is optional at startup - you can also configure the wallet at runtime using the `configure_wallet` tool.
38
+
39
+ ## Quick Start
40
+
41
+ Typical workflow:
42
+
43
+ 1. **Configure wallet** - `configure_wallet` with your private key
44
+ 2. **Setup space** - `setup_space` creates or finds your personal space
45
+ 3. **Build knowledge** - use any graph tools to create properties, types, entities, and relations
46
+ 4. **Publish** - `publish_edit` sends all accumulated ops on-chain in one transaction
47
+
48
+ ### Example: Create a Knowledge Graph in One Call
49
+
50
+ Use `create_knowledge_graph` for the best UX - it builds schema, entities, and relations all at once with name-based references:
51
+
52
+ ```
53
+ create_knowledge_graph({
54
+ schema: {
55
+ properties: [
56
+ { name: "Founded", dataType: "DATE" },
57
+ { name: "Website", dataType: "TEXT" }
58
+ ],
59
+ types: [
60
+ { name: "Company", propertyNames: ["Founded", "Website"] }
61
+ ]
62
+ },
63
+ entities: [
64
+ {
65
+ name: "Geo",
66
+ typeName: "Company",
67
+ values: [
68
+ { propertyName: "Founded", type: "date", value: "2024-01-01" },
69
+ { propertyName: "Website", type: "text", value: "https://geo.xyz" }
70
+ ]
71
+ }
72
+ ]
73
+ })
74
+ ```
75
+
76
+ ## Tools Reference
77
+
78
+ ### Graph Operations (8 tools)
79
+
80
+ | Tool | Description |
81
+ |------|-------------|
82
+ | `create_property` | Create a property definition with a data type |
83
+ | `create_type` | Create a type (schema) grouping properties |
84
+ | `create_entity` | Create an entity with types, values, and relations |
85
+ | `create_relation` | Create a relation between two entities |
86
+ | `create_image` | Create an image entity from a URL |
87
+ | `update_entity` | Update an existing entity's name, values, or properties |
88
+ | `delete_entity` | Delete an entity |
89
+ | `delete_relation` | Delete a relation |
90
+
91
+ ### Space & Publishing (6 tools)
92
+
93
+ | Tool | Description |
94
+ |------|-------------|
95
+ | `configure_wallet` | Set up wallet with a private key for publishing |
96
+ | `setup_space` | Create or find your personal space |
97
+ | `publish_edit` | Publish all accumulated ops as one on-chain edit |
98
+ | `propose_dao_edit` | Propose accumulated ops as a DAO governance edit |
99
+ | `get_session_status` | View current session state (ops count, artifacts, wallet) |
100
+ | `clear_session` | Discard all accumulated ops |
101
+
102
+ ### Advanced UX (5 tools)
103
+
104
+ | Tool | Description |
105
+ |------|-------------|
106
+ | `generate_id` | Generate one or more unique Geo IDs (dashless UUID v4) |
107
+ | `build_schema` | Create properties + types in one call with name-based references |
108
+ | `create_knowledge_graph` | Build complete graph (schema + entities + relations) in one call |
109
+ | `add_values_to_entity` | Add multiple property values to an existing entity |
110
+ | `get_system_ids` | Get well-known Geo system IDs (types, properties, data types) |
111
+
112
+ ### Supported Data Types
113
+
114
+ `TEXT`, `INTEGER`, `FLOAT`, `BOOLEAN`, `DATE`, `TIME`, `DATETIME`, `SCHEDULE`, `POINT`, `DECIMAL`, `BYTES`, `EMBEDDING`, `RELATION`
115
+
116
+ ## Development
117
+
118
+ ```bash
119
+ npm run dev # Run with tsx (hot reload)
120
+ npm run build # Compile TypeScript
121
+ npm run typecheck # Type check without emitting
122
+ npm start # Run compiled version
123
+ ```
124
+
125
+ ## Network
126
+
127
+ Currently operates on the Geo **testnet**.
128
+
129
+ ## License
130
+
131
+ MIT
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { createServer } from './server.js';
4
+ async function main() {
5
+ const server = createServer();
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);
8
+ console.error('Geo MCP server running on stdio');
9
+ }
10
+ main().catch((error) => {
11
+ console.error('Fatal error:', error);
12
+ process.exit(1);
13
+ });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function createServer(): McpServer;
3
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,wBAAgB,YAAY,IAAI,SAAS,CAWxC"}
package/dist/server.js ADDED
@@ -0,0 +1,16 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { session } from './state/session.js';
3
+ import { registerGraphTools } from './tools/graph.js';
4
+ import { registerSpaceTools } from './tools/spaces.js';
5
+ import { registerAdvancedTools } from './tools/advanced.js';
6
+ export function createServer() {
7
+ const server = new McpServer({
8
+ name: 'geo-mcp-server',
9
+ version: '1.0.0',
10
+ });
11
+ registerGraphTools(server, session);
12
+ registerSpaceTools(server, session);
13
+ registerAdvancedTools(server, session);
14
+ return server;
15
+ }
16
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Edit session state management for the Geo MCP server.
3
+ * Manages op accumulation across tool calls and tracks created artifacts.
4
+ */
5
+ import type { Op } from '@geoprotocol/grc-20';
6
+ export interface CreatedArtifact {
7
+ id: string;
8
+ type: 'property' | 'type' | 'entity' | 'relation' | 'image';
9
+ name: string;
10
+ opsCount: number;
11
+ }
12
+ export interface SessionStatus {
13
+ opsCount: number;
14
+ artifacts: CreatedArtifact[];
15
+ walletConfigured: boolean;
16
+ spaceId: string | null;
17
+ network: 'TESTNET';
18
+ }
19
+ export declare class EditSession {
20
+ private ops;
21
+ private artifacts;
22
+ private _privateKey;
23
+ private _spaceId;
24
+ private _walletAddress;
25
+ addOps(ops: Op[], artifact: CreatedArtifact): void;
26
+ getOps(): Op[];
27
+ getArtifacts(): CreatedArtifact[];
28
+ clear(): void;
29
+ get opsCount(): number;
30
+ get privateKey(): string | null;
31
+ set privateKey(key: string | null);
32
+ get spaceId(): string | null;
33
+ set spaceId(id: string | null);
34
+ get walletAddress(): string | null;
35
+ set walletAddress(address: string | null);
36
+ getStatus(): SessionStatus;
37
+ }
38
+ export declare const session: EditSession;
39
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/state/session.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,cAAc,CAAuB;IAE7C,MAAM,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI;IAKlD,MAAM,IAAI,EAAE,EAAE;IAId,YAAY,IAAI,eAAe,EAAE;IAIjC,KAAK,IAAI,IAAI;IAKb,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IAED,IAAI,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAEhC;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAE3B;IAED,IAAI,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,EAE5B;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,IAAI,CAEjC;IAED,IAAI,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAEvC;IAED,SAAS,IAAI,aAAa;CAS3B;AAGD,eAAO,MAAM,OAAO,aAAoB,CAAC"}
@@ -0,0 +1,54 @@
1
+ export class EditSession {
2
+ ops = [];
3
+ artifacts = [];
4
+ _privateKey = null;
5
+ _spaceId = null;
6
+ _walletAddress = null;
7
+ addOps(ops, artifact) {
8
+ this.ops.push(...ops);
9
+ this.artifacts.push(artifact);
10
+ }
11
+ getOps() {
12
+ return [...this.ops];
13
+ }
14
+ getArtifacts() {
15
+ return [...this.artifacts];
16
+ }
17
+ clear() {
18
+ this.ops = [];
19
+ this.artifacts = [];
20
+ }
21
+ get opsCount() {
22
+ return this.ops.length;
23
+ }
24
+ get privateKey() {
25
+ return this._privateKey;
26
+ }
27
+ set privateKey(key) {
28
+ this._privateKey = key;
29
+ }
30
+ get spaceId() {
31
+ return this._spaceId;
32
+ }
33
+ set spaceId(id) {
34
+ this._spaceId = id;
35
+ }
36
+ get walletAddress() {
37
+ return this._walletAddress;
38
+ }
39
+ set walletAddress(address) {
40
+ this._walletAddress = address;
41
+ }
42
+ getStatus() {
43
+ return {
44
+ opsCount: this.ops.length,
45
+ artifacts: [...this.artifacts],
46
+ walletConfigured: this._privateKey !== null,
47
+ spaceId: this._spaceId,
48
+ network: 'TESTNET',
49
+ };
50
+ }
51
+ }
52
+ // Singleton session instance
53
+ export const session = new EditSession();
54
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/state/session.ts"],"names":[],"mappings":"AAqBA,MAAM,OAAO,WAAW;IACd,GAAG,GAAS,EAAE,CAAC;IACf,SAAS,GAAsB,EAAE,CAAC;IAClC,WAAW,GAAkB,IAAI,CAAC;IAClC,QAAQ,GAAkB,IAAI,CAAC;IAC/B,cAAc,GAAkB,IAAI,CAAC;IAE7C,MAAM,CAAC,GAAS,EAAE,QAAyB;QACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,MAAM;QACJ,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,YAAY;QACV,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU,CAAC,GAAkB;QAC/B,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC;IACzB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,IAAI,OAAO,CAAC,EAAiB;QAC3B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,IAAI,aAAa,CAAC,OAAsB;QACtC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,SAAS;QACP,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM;YACzB,SAAS,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;YAC9B,gBAAgB,EAAE,IAAI,CAAC,WAAW,KAAK,IAAI;YAC3C,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,OAAO,EAAE,SAAS;SACnB,CAAC;IACJ,CAAC;CACF;AAED,6BAA6B;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Advanced high-level MCP tools that combine multiple SDK operations
3
+ * for a better UX experience.
4
+ */
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import type { EditSession } from '../state/session.js';
7
+ export declare function registerAdvancedTools(server: McpServer, session: EditSession): void;
8
+ //# sourceMappingURL=advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../../src/tools/advanced.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAghBnF"}