widespread-tools 0.0.0-stage → 0.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/README.md +14 -2
- package/index.js +37 -0
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# widespread-tools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thin JS helpers for wiring the [Widespread](https://github.com/TerexitariusStomp/widespread-bridge)
|
|
4
|
+
MCP server into agent frameworks. Non-custodial — client-held Ed25519 keys.
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
import { mcpConfig, rpc } from "widespread-tools";
|
|
8
|
+
|
|
9
|
+
// LangChain / Vercel / OpenAI Agents — pass mcpConfig.remote to your MCP client
|
|
10
|
+
// or call tools directly:
|
|
11
|
+
const tools = await rpc("tools/list");
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Remote endpoint: `https://widespread-bridge.widespread.workers.dev/mcp`
|
|
15
|
+
Local key-holding server: `uvx widespread-mcp` · Install page: https://widespread-bridge.widespread.workers.dev/install
|
package/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* widespread-tools — thin helpers for wiring the Widespread MCP server into
|
|
3
|
+
* agent frameworks (LangChain, Vercel AI SDK, OpenAI Agents, etc.).
|
|
4
|
+
* Non-custodial: keys stay client-side; the bridge only verifies signatures.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const MCP_URL = "https://widespread-bridge.widespread.workers.dev/mcp";
|
|
8
|
+
export const OPENAPI_URL = "https://widespread-bridge.widespread.workers.dev/openapi.json";
|
|
9
|
+
|
|
10
|
+
/** MCP client config — pass to any MCP-aware framework client. */
|
|
11
|
+
export const mcpConfig = {
|
|
12
|
+
remote: { type: "streamable-http", url: MCP_URL },
|
|
13
|
+
local: { command: "uvx", args: ["widespread-mcp"] },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** Tool names exposed on the remote endpoint. */
|
|
17
|
+
export const TOOLS = [
|
|
18
|
+
"feed_search", "feed_get", "feed_stats", "runners_list",
|
|
19
|
+
"wide_markets", "wide_bounties",
|
|
20
|
+
"wide_agent_challenge", "wide_agent_register",
|
|
21
|
+
"wide_claim", "wide_ship_prepare", "wide_ship_submit", "wide_status",
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
/** JSON-RPC call helper for the remote endpoint. */
|
|
25
|
+
export async function rpc(method, params = {}, { url = MCP_URL } = {}) {
|
|
26
|
+
const res = await fetch(url, {
|
|
27
|
+
method: "POST",
|
|
28
|
+
headers: {
|
|
29
|
+
"content-type": "application/json",
|
|
30
|
+
accept: "application/json, text/event-stream",
|
|
31
|
+
},
|
|
32
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
33
|
+
});
|
|
34
|
+
const text = await res.text();
|
|
35
|
+
const m = text.match(/^data: (.*)$/m);
|
|
36
|
+
return JSON.parse(m ? m[1] : text);
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "widespread-tools",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Widespread protocol client helpers — MCP endpoint config + tool descriptors for LangChain/Vercel AI SDK/agents",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "TerexitariusStomp",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"exports": { ".": "./index.js" },
|
|
10
|
+
"repository": { "type": "git", "url": "https://github.com/TerexitariusStomp/widespread-bridge" },
|
|
11
|
+
"keywords": ["mcp", "agents", "bounties", "llm", "tools"]
|
|
12
|
+
}
|