fathom-mcp 2.0.0 → 2.1.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/index.js +51 -4
- package/package.json +10 -4
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Connects to any Fathom instance (self-hosted or cloud). Discovers
|
|
6
6
|
* available tools from GET /v1/tools, filtered by the token's scopes.
|
|
7
|
+
* Exposes the identity crystal as an MCP resource.
|
|
7
8
|
*
|
|
8
9
|
* Environment:
|
|
9
10
|
* FATHOM_API_URL — base URL (default: http://localhost:8201)
|
|
@@ -16,7 +17,12 @@
|
|
|
16
17
|
|
|
17
18
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
18
19
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
19
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
CallToolRequestSchema,
|
|
22
|
+
ListToolsRequestSchema,
|
|
23
|
+
ListResourcesRequestSchema,
|
|
24
|
+
ReadResourceRequestSchema,
|
|
25
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
20
26
|
|
|
21
27
|
const API_URL = (process.env.FATHOM_API_URL || "http://localhost:8201").replace(/\/$/, "");
|
|
22
28
|
const API_KEY = process.env.FATHOM_API_KEY || "";
|
|
@@ -113,15 +119,15 @@ async function main() {
|
|
|
113
119
|
process.exit(1);
|
|
114
120
|
}
|
|
115
121
|
|
|
116
|
-
// Build lookup
|
|
117
122
|
const toolMap = {};
|
|
118
123
|
for (const t of tools) toolMap[t.name] = t;
|
|
119
124
|
|
|
120
125
|
const server = new Server(
|
|
121
|
-
{ name: "Fathom", version: "
|
|
122
|
-
{ capabilities: { tools: {} } },
|
|
126
|
+
{ name: "Fathom", version: "2.1.0" },
|
|
127
|
+
{ capabilities: { tools: {}, resources: {} } },
|
|
123
128
|
);
|
|
124
129
|
|
|
130
|
+
// Tools — dynamic from /v1/tools
|
|
125
131
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
126
132
|
tools: tools.map(t => ({
|
|
127
133
|
name: t.name,
|
|
@@ -144,6 +150,47 @@ async function main() {
|
|
|
144
150
|
}
|
|
145
151
|
});
|
|
146
152
|
|
|
153
|
+
// Resources — identity crystal
|
|
154
|
+
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
|
|
155
|
+
resources: [
|
|
156
|
+
{
|
|
157
|
+
uri: "fathom://crystal",
|
|
158
|
+
name: "Identity Crystal",
|
|
159
|
+
description: "Fathom's identity — a first-person synthesis of who this mind is. Read this at the start of every conversation for persistent context.",
|
|
160
|
+
mimeType: "text/plain",
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
}));
|
|
164
|
+
|
|
165
|
+
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
166
|
+
const { uri } = request.params;
|
|
167
|
+
if (uri === "fathom://crystal") {
|
|
168
|
+
try {
|
|
169
|
+
const r = await fetch(`${API_URL}/v1/crystal`, { headers: authHeaders(false) });
|
|
170
|
+
if (r.ok) {
|
|
171
|
+
const data = await r.json();
|
|
172
|
+
const text = data.text || "No crystal generated yet.";
|
|
173
|
+
const created = data.created_at || "unknown";
|
|
174
|
+
return {
|
|
175
|
+
contents: [{
|
|
176
|
+
uri,
|
|
177
|
+
mimeType: "text/plain",
|
|
178
|
+
text: `Identity crystal (crystallized ${created}):\n\n${text}`,
|
|
179
|
+
}],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
} catch {}
|
|
183
|
+
return {
|
|
184
|
+
contents: [{
|
|
185
|
+
uri,
|
|
186
|
+
mimeType: "text/plain",
|
|
187
|
+
text: "No identity crystal available. Generate one from the Fathom dashboard.",
|
|
188
|
+
}],
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
throw new Error(`Unknown resource: ${uri}`);
|
|
192
|
+
});
|
|
193
|
+
|
|
147
194
|
const transport = new StdioServerTransport();
|
|
148
195
|
await server.connect(transport);
|
|
149
196
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fathom-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Connect any MCP host to your Fathom memory lake",
|
|
5
5
|
"bin": {
|
|
6
|
-
"fathom-mcp": "
|
|
6
|
+
"fathom-mcp": "index.js"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@modelcontextprotocol/sdk": "^1.12.0"
|
|
11
11
|
},
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"fathom",
|
|
15
|
+
"memory",
|
|
16
|
+
"delta-lake",
|
|
17
|
+
"claude"
|
|
18
|
+
],
|
|
13
19
|
"license": "MIT",
|
|
14
20
|
"repository": {
|
|
15
21
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/fathom-ai/fathom-mcp"
|
|
22
|
+
"url": "git+https://github.com/fathom-ai/fathom-mcp.git"
|
|
17
23
|
}
|
|
18
24
|
}
|