@dataville/dataville-mcp 0.1.2 → 0.1.3
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/dist/client.js +11 -3
- package/dist/sources.js +5 -2
- package/package.json +3 -2
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.3";
|
|
4
4
|
const USER_AGENT = `dataville-mcp/${VERSION}`;
|
|
5
5
|
export class DatavilleApiError extends Error {
|
|
6
6
|
status;
|
|
@@ -49,8 +49,16 @@ export async function searchDataSource(source, keywords, params) {
|
|
|
49
49
|
});
|
|
50
50
|
const body = await response.json().catch(() => undefined);
|
|
51
51
|
if (!response.ok) {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
// Errors come back as { status: "error", data: { error: "..." } }. Those
|
|
53
|
+
// messages are useful to the model — "no results for X", or the full list
|
|
54
|
+
// of valid sources — so prefer them over a bare status code.
|
|
55
|
+
const apiMessage = body && typeof body === "object"
|
|
56
|
+
? body.data?.error ??
|
|
57
|
+
body.error
|
|
58
|
+
: undefined;
|
|
59
|
+
const message = typeof apiMessage === "string" && apiMessage.length > 0
|
|
60
|
+
? apiMessage
|
|
61
|
+
: `Dataville API request failed with status ${response.status}`;
|
|
54
62
|
throw new DatavilleApiError(response.status, message);
|
|
55
63
|
}
|
|
56
64
|
// We always send an API key, so an "anonymous" account state means the key
|
package/dist/sources.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// Hand-maintained list of data sources supported by the Dataville API.
|
|
2
|
-
//
|
|
2
|
+
// The `name` values must match the source names the API accepts — a mismatch
|
|
3
|
+
// makes the source unreachable. To check against the live API, request an
|
|
4
|
+
// unknown source (e.g. /nosuchsource/foo); the error lists every valid name.
|
|
3
5
|
export const DATAVILLE_SOURCES = [
|
|
4
6
|
{ name: "wikipedia", description: "Wikipedia articles" },
|
|
5
7
|
{ name: "arxiv", description: "arXiv preprints" },
|
|
6
8
|
{ name: "gutenberg", description: "Project Gutenberg public-domain books" },
|
|
7
9
|
{ name: "census", description: "US Census Bureau data" },
|
|
8
10
|
{ name: "fooddata", description: "USDA FoodData Central" },
|
|
9
|
-
{ name: "
|
|
11
|
+
{ name: "paperswithcode", description: "Papers with Code — ML papers, code, and benchmarks" },
|
|
10
12
|
{ name: "edgar", description: "SEC EDGAR filings" },
|
|
11
13
|
{ name: "openalex", description: "OpenAlex scholarly works" },
|
|
12
14
|
{ name: "pypi", description: "PyPI package metadata" },
|
|
13
15
|
{ name: "stackexchange", description: "Stack Exchange Q&A" },
|
|
16
|
+
{ name: "news", description: "News front-page headlines and summaries" },
|
|
14
17
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataville/dataville-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "MCP server exposing Dataville's data source API as tools for MCP clients",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"dev": "tsx watch src/index.ts",
|
|
24
24
|
"start": "node dist/index.js",
|
|
25
|
-
"test": "tsx --test src/__tests__/*.test.ts"
|
|
25
|
+
"test": "tsx --test src/__tests__/*.test.ts",
|
|
26
|
+
"test:integration": "tsx --test src/__tests__/*.itest.ts"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
29
|
"@modelcontextprotocol/sdk": "^1.12.0",
|