@topolo/mcp 0.2.0 → 0.2.2
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 +15 -13
- package/dist/index.js +25 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,8 @@ Either:
|
|
|
27
27
|
- **Long-lived**: mint an API key at the Topolo Developers console
|
|
28
28
|
(`TOPOLO_API_KEY=topo_live_...`). Preferred for persistent agent installs.
|
|
29
29
|
- **Short-lived**: `topolo auth login` with the CLI, then copy the access token
|
|
30
|
-
from `~/.config/topolo/config.json`. Useful for dev and testing.
|
|
30
|
+
from `~/.config/topolo/config.json`. Useful for dev and testing. MCP does
|
|
31
|
+
not read the CLI config directly; pass the token in `TOPOLO_ACCESS_TOKEN`.
|
|
31
32
|
|
|
32
33
|
## Register with an MCP client
|
|
33
34
|
|
|
@@ -94,17 +95,20 @@ Startup is synchronous and fast (< 500 ms typical). If the credential is
|
|
|
94
95
|
rejected, the process logs the error to stderr and exits non-zero — host
|
|
95
96
|
clients surface that as a failed server launch.
|
|
96
97
|
|
|
97
|
-
## Tools
|
|
98
|
+
## Tools
|
|
98
99
|
|
|
99
|
-
| Tool | Required scopes | Destructive |
|
|
100
|
-
| ---------------------------- | --------------------- |
|
|
101
|
-
| `topolo_whoami` | (none) | no
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
100
|
+
| Tool | Required scopes | Destructive hint |
|
|
101
|
+
| ---------------------------- | --------------------- | ---------------- |
|
|
102
|
+
| `topolo_whoami` | (none) | no |
|
|
103
|
+
| `topolo_list_services` | (none) | no |
|
|
104
|
+
| `topolo_crm_list_contacts` | `crm.contacts:read` | no |
|
|
105
|
+
| `topolo_crm_get_contact` | `crm.contacts:read` | no |
|
|
106
|
+
| `topolo_api_call` | (service-enforced) | yes |
|
|
104
107
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
`
|
|
108
|
+
`topolo_api_call` is the escape hatch for endpoints without typed MCP tools
|
|
109
|
+
yet. GET requests work without confirmation; mutating HTTP methods must pass
|
|
110
|
+
`confirm: true` or the SDK rejects the call. Backing services still enforce
|
|
111
|
+
permissions for every request.
|
|
108
112
|
|
|
109
113
|
## Safety rails
|
|
110
114
|
|
|
@@ -159,8 +163,6 @@ build, verify the tag matches `package.json`, and publish to npm via the
|
|
|
159
163
|
|
|
160
164
|
## Phase 2 (planned)
|
|
161
165
|
|
|
162
|
-
-
|
|
163
|
-
in TopoloAuth.
|
|
164
|
-
- Dynamic tool registration as more `@topolo/sdk` modules ship.
|
|
166
|
+
- More typed tools as `@topolo/sdk` modules ship.
|
|
165
167
|
- HTTP transport in addition to stdio, for hosted (non-subprocess) deployments.
|
|
166
168
|
- Optional `--provenance` on npm publish once the repo is public.
|
package/dist/index.js
CHANGED
|
@@ -391,7 +391,10 @@ function hasScope(set, required) {
|
|
|
391
391
|
"*",
|
|
392
392
|
serviceId ? `${serviceId}.*` : null,
|
|
393
393
|
serviceId && resource && actionPart ? `${serviceId}.${resource}:*` : null,
|
|
394
|
-
resource && actionPart ? `${resource}
|
|
394
|
+
serviceId && resource && actionPart ? `${serviceId}.${resource}.${actionPart}` : null,
|
|
395
|
+
resource && actionPart ? `${resource}:*` : null,
|
|
396
|
+
resource && actionPart ? `${resource}.${actionPart}` : null,
|
|
397
|
+
resource && actionPart ? `${resource}:${actionPart}` : null
|
|
395
398
|
].filter((v) => v !== null));
|
|
396
399
|
return set.permissions.some((granted) => candidates.has(granted));
|
|
397
400
|
}
|
|
@@ -427,6 +430,26 @@ var TOOLS = [
|
|
|
427
430
|
},
|
|
428
431
|
handler: async (topolo) => topolo.identity.whoami()
|
|
429
432
|
},
|
|
433
|
+
{
|
|
434
|
+
name: "topolo_list_services",
|
|
435
|
+
title: "List every Topolo service the agent can reach",
|
|
436
|
+
description: "Returns the service registry the SDK knows about: one entry per platform service with its stable service ID and current base URL. Use this to discover what `topolo_api_call` can address \u2014 the service IDs returned here are the exact values accepted by that tool. Pure metadata: no credential introspection, no permission check, no external call.",
|
|
437
|
+
requiredScopes: [],
|
|
438
|
+
destructive: false,
|
|
439
|
+
inputSchema: {
|
|
440
|
+
type: "object",
|
|
441
|
+
properties: {},
|
|
442
|
+
additionalProperties: false
|
|
443
|
+
},
|
|
444
|
+
handler: async () => {
|
|
445
|
+
const services = Object.keys(DEFAULT_SERVICE_URLS).sort().map((id) => ({
|
|
446
|
+
id,
|
|
447
|
+
defaultUrl: DEFAULT_SERVICE_URLS[id],
|
|
448
|
+
effectiveUrl: resolveServiceUrl(id)
|
|
449
|
+
}));
|
|
450
|
+
return { services };
|
|
451
|
+
}
|
|
452
|
+
},
|
|
430
453
|
{
|
|
431
454
|
name: "topolo_crm_list_contacts",
|
|
432
455
|
title: "List CRM contacts",
|
|
@@ -549,7 +572,7 @@ function filterToolsByScopes(tools, scopes) {
|
|
|
549
572
|
}
|
|
550
573
|
|
|
551
574
|
// src/version.ts
|
|
552
|
-
var MCP_VERSION = "0.
|
|
575
|
+
var MCP_VERSION = "0.2.2";
|
|
553
576
|
|
|
554
577
|
// src/server.ts
|
|
555
578
|
function buildServer(topolo, scopes, tools = TOOLS) {
|
package/package.json
CHANGED