@dataville/dataville-mcp 0.1.5 → 0.1.6
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 +19 -0
- package/dist/client.js +1 -1
- package/dist/index.js +2 -37
- package/dist/server.js +53 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# dataville-mcp
|
|
2
2
|
|
|
3
|
+
[](https://m8ven.ai/mcp/datavilleorg-dataville-mcp-u1eou7?s=readme)
|
|
4
|
+
[](https://www.npmjs.com/package/@dataville/dataville-mcp)
|
|
5
|
+
[](https://github.com/datavilleorg/dataville-mcp/actions/workflows/ci.yml)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
[](https://cursor.com/en/install-mcp?name=dataville&config=eyJ1cmwiOiJodHRwczovL2FwaS5kYXRhdmlsbGUuY29tL21jcCJ9)
|
|
9
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=dataville&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.dataville.com%2Fmcp%22%7D)
|
|
10
|
+
|
|
3
11
|
MCP server exposing Dataville's data source API as tools for MCP clients (Claude Desktop, Claude Code, etc.).
|
|
4
12
|
|
|
5
13
|
[Dataville](https://dataville.com) is a unified REST API over ten public datasets —
|
|
@@ -15,6 +23,16 @@ Requires a Dataville API key — get one from the [Dataville dashboard](https://
|
|
|
15
23
|
- `list_dataville_sources` — lists the data sources available via `search_dataville`.
|
|
16
24
|
- `search_dataville` — query a data source: `{ source, keywords, params? }`.
|
|
17
25
|
|
|
26
|
+
## What you can ask
|
|
27
|
+
|
|
28
|
+
Once connected, ask in plain language and the client picks the source:
|
|
29
|
+
|
|
30
|
+
- "Find an arXiv paper on retrieval-augmented generation and summarize it."
|
|
31
|
+
- "What did Apple report in its latest SEC filing?"
|
|
32
|
+
- "What's the median household income in Travis County, Texas, per the US Census?"
|
|
33
|
+
- "How much protein is in 100 g of cooked lentils, according to USDA FoodData?"
|
|
34
|
+
- "Look up the `requests` package on PyPI — what's the latest version and license?"
|
|
35
|
+
|
|
18
36
|
## Setup
|
|
19
37
|
|
|
20
38
|
This package is a local (stdio) MCP server: the client launches it on your
|
|
@@ -32,6 +50,7 @@ claude mcp add --transport http dataville https://api.dataville.com/mcp
|
|
|
32
50
|
|
|
33
51
|
That works with no credentials at all (anonymous limits). Add
|
|
34
52
|
`--header "Authorization: Bearer dataville_your_key_here"` for the full quota.
|
|
53
|
+
Cursor and VS Code users can use the install buttons at the top of this page.
|
|
35
54
|
Other clients take the same URL; the app's Integrations page has the exact
|
|
36
55
|
snippet for each. Use the hosted endpoint unless you specifically want to pin a
|
|
37
56
|
version or work offline — the rest of this section covers that local setup.
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const DEFAULT_BASE_URL = "https://api.dataville.com";
|
|
2
2
|
// Keep in sync with package.json version (enforced by a test).
|
|
3
|
-
export const VERSION = "0.1.
|
|
3
|
+
export const VERSION = "0.1.6";
|
|
4
4
|
const USER_AGENT = `dataville-mcp/${VERSION}`;
|
|
5
5
|
export class DatavilleApiError extends Error {
|
|
6
6
|
status;
|
package/dist/index.js
CHANGED
|
@@ -1,44 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
-
import {
|
|
5
|
-
import { searchDataSource, VERSION } from "./client.js";
|
|
6
|
-
import { DATAVILLE_SOURCES } from "./sources.js";
|
|
7
|
-
const server = new McpServer({
|
|
8
|
-
name: "dataville-mcp-server",
|
|
9
|
-
version: VERSION,
|
|
10
|
-
});
|
|
11
|
-
server.registerTool("list_dataville_sources", {
|
|
12
|
-
title: "List Dataville data sources",
|
|
13
|
-
description: "List the data sources available through Dataville's search_dataville tool.",
|
|
14
|
-
inputSchema: {},
|
|
15
|
-
}, async () => ({
|
|
16
|
-
content: [{ type: "text", text: JSON.stringify(DATAVILLE_SOURCES, null, 2) }],
|
|
17
|
-
}));
|
|
18
|
-
server.registerTool("search_dataville", {
|
|
19
|
-
title: "Search a Dataville data source",
|
|
20
|
-
description: "Query one of Dataville's data sources (see list_dataville_sources for valid source names) with a keyword string and optional query params.",
|
|
21
|
-
inputSchema: {
|
|
22
|
-
source: z.string().describe("Data source name, e.g. 'wikipedia', 'arxiv', 'edgar'"),
|
|
23
|
-
keywords: z.string().describe("Search keywords or identifier for the query"),
|
|
24
|
-
params: z
|
|
25
|
-
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
26
|
-
.optional()
|
|
27
|
-
.describe("Optional additional query parameters"),
|
|
28
|
-
},
|
|
29
|
-
}, async ({ source, keywords, params }) => {
|
|
30
|
-
try {
|
|
31
|
-
const result = await searchDataSource(source, keywords, params);
|
|
32
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
36
|
-
return { content: [{ type: "text", text: message }], isError: true };
|
|
37
|
-
}
|
|
38
|
-
});
|
|
3
|
+
import { createServer } from "./server.js";
|
|
39
4
|
async function main() {
|
|
40
5
|
const transport = new StdioServerTransport();
|
|
41
|
-
await
|
|
6
|
+
await createServer().connect(transport);
|
|
42
7
|
}
|
|
43
8
|
main().catch((error) => {
|
|
44
9
|
console.error("Fatal error starting Dataville MCP server:", error);
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { searchDataSource, VERSION } from "./client.js";
|
|
4
|
+
import { DATAVILLE_SOURCES } from "./sources.js";
|
|
5
|
+
export function createServer() {
|
|
6
|
+
const server = new McpServer({
|
|
7
|
+
name: "dataville-mcp-server",
|
|
8
|
+
version: VERSION,
|
|
9
|
+
});
|
|
10
|
+
server.registerTool("list_dataville_sources", {
|
|
11
|
+
title: "List Dataville data sources",
|
|
12
|
+
description: "List the data sources available through Dataville's search_dataville tool.",
|
|
13
|
+
inputSchema: {},
|
|
14
|
+
// Returns a static list bundled with the server; makes no network calls.
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
21
|
+
}, async () => ({
|
|
22
|
+
content: [{ type: "text", text: JSON.stringify(DATAVILLE_SOURCES, null, 2) }],
|
|
23
|
+
}));
|
|
24
|
+
server.registerTool("search_dataville", {
|
|
25
|
+
title: "Search a Dataville data source",
|
|
26
|
+
description: "Query one of Dataville's data sources (see list_dataville_sources for valid source names) with a keyword string and optional query params.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
source: z.string().describe("Data source name, e.g. 'wikipedia', 'arxiv', 'edgar'"),
|
|
29
|
+
keywords: z.string().describe("Search keywords or identifier for the query"),
|
|
30
|
+
params: z
|
|
31
|
+
.record(z.union([z.string(), z.number(), z.boolean()]))
|
|
32
|
+
.optional()
|
|
33
|
+
.describe("Optional additional query parameters"),
|
|
34
|
+
},
|
|
35
|
+
// A GET against the Dataville API, which fronts external data sources.
|
|
36
|
+
annotations: {
|
|
37
|
+
readOnlyHint: true,
|
|
38
|
+
destructiveHint: false,
|
|
39
|
+
idempotentHint: true,
|
|
40
|
+
openWorldHint: true,
|
|
41
|
+
},
|
|
42
|
+
}, async ({ source, keywords, params }) => {
|
|
43
|
+
try {
|
|
44
|
+
const result = await searchDataSource(source, keywords, params);
|
|
45
|
+
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
return { content: [{ type: "text", text: message }], isError: true };
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return server;
|
|
53
|
+
}
|
package/package.json
CHANGED