@bastani/atomic 0.9.25-alpha.3 → 0.9.25-alpha.4
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/CHANGELOG.md +28 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +30 -0
- package/dist/builtin/mcp/OAUTH.md +59 -269
- package/dist/builtin/mcp/README.md +58 -345
- package/dist/builtin/mcp/index.bundle.mjs +4 -28073
- package/dist/builtin/mcp/native-client-licenses/LICENSES/modelcontextprotocol-typescript-sdk.txt +21 -0
- package/dist/builtin/mcp/native-client-licenses/NOTICE +30 -0
- package/dist/builtin/mcp/package.json +4 -25
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +2 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +87 -5
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +6 -3
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +3 -1
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +4 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +3 -0
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/mcp-child-policy.d.ts +11 -0
- package/dist/core/mcp-child-policy.d.ts.map +1 -0
- package/dist/core/mcp-child-policy.js +31 -0
- package/dist/core/mcp-child-policy.js.map +1 -0
- package/dist/core/mcp-servers.d.ts +32 -26
- package/dist/core/mcp-servers.d.ts.map +1 -1
- package/dist/core/mcp-servers.js +148 -1
- package/dist/core/mcp-servers.js.map +1 -1
- package/dist/core/package-manager-manifest.js.map +1 -1
- package/dist/core/package-manager-mcp-servers.js +1 -1
- package/dist/core/package-manager-mcp-servers.js.map +1 -1
- package/dist/core/sdk.js +10 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +8 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +24 -0
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/extensions/mcp/cli.d.ts +21 -0
- package/dist/extensions/mcp/cli.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.js +500 -0
- package/dist/extensions/mcp/cli.js.map +1 -0
- package/dist/extensions/mcp/cli.lazy.d.ts +3 -0
- package/dist/extensions/mcp/cli.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/cli.lazy.js +3 -0
- package/dist/extensions/mcp/cli.lazy.js.map +1 -0
- package/dist/extensions/mcp/client/auth-provider.d.ts +15 -0
- package/dist/extensions/mcp/client/auth-provider.d.ts.map +1 -0
- package/dist/extensions/mcp/client/auth-provider.js +2 -0
- package/dist/extensions/mcp/client/auth-provider.js.map +1 -0
- package/dist/extensions/mcp/client/client.d.ts +89 -0
- package/dist/extensions/mcp/client/client.d.ts.map +1 -0
- package/dist/extensions/mcp/client/client.js +457 -0
- package/dist/extensions/mcp/client/client.js.map +1 -0
- package/dist/extensions/mcp/client/index.d.ts +9 -0
- package/dist/extensions/mcp/client/index.d.ts.map +1 -0
- package/dist/extensions/mcp/client/index.js +7 -0
- package/dist/extensions/mcp/client/index.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/callback.d.ts +42 -0
- package/dist/extensions/mcp/client/oauth/callback.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/callback.js +106 -0
- package/dist/extensions/mcp/client/oauth/callback.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/discovery.d.ts +27 -0
- package/dist/extensions/mcp/client/oauth/discovery.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/discovery.js +153 -0
- package/dist/extensions/mcp/client/oauth/discovery.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/errors.d.ts +24 -0
- package/dist/extensions/mcp/client/oauth/errors.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/errors.js +46 -0
- package/dist/extensions/mcp/client/oauth/errors.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/flow.d.ts +82 -0
- package/dist/extensions/mcp/client/oauth/flow.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/flow.js +292 -0
- package/dist/extensions/mcp/client/oauth/flow.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/index.d.ts +7 -0
- package/dist/extensions/mcp/client/oauth/index.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/index.js +6 -0
- package/dist/extensions/mcp/client/oauth/index.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/provider.d.ts +59 -0
- package/dist/extensions/mcp/client/oauth/provider.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/provider.js +116 -0
- package/dist/extensions/mcp/client/oauth/provider.js.map +1 -0
- package/dist/extensions/mcp/client/oauth/types.d.ts +77 -0
- package/dist/extensions/mcp/client/oauth/types.d.ts.map +1 -0
- package/dist/extensions/mcp/client/oauth/types.js +109 -0
- package/dist/extensions/mcp/client/oauth/types.js.map +1 -0
- package/dist/extensions/mcp/client/protocol/content.d.ts +82 -0
- package/dist/extensions/mcp/client/protocol/content.d.ts.map +1 -0
- package/dist/extensions/mcp/client/protocol/content.js +41 -0
- package/dist/extensions/mcp/client/protocol/content.js.map +1 -0
- package/dist/extensions/mcp/client/protocol/jsonrpc.d.ts +59 -0
- package/dist/extensions/mcp/client/protocol/jsonrpc.d.ts.map +1 -0
- package/dist/extensions/mcp/client/protocol/jsonrpc.js +67 -0
- package/dist/extensions/mcp/client/protocol/jsonrpc.js.map +1 -0
- package/dist/extensions/mcp/client/protocol/types.d.ts +123 -0
- package/dist/extensions/mcp/client/protocol/types.d.ts.map +1 -0
- package/dist/extensions/mcp/client/protocol/types.js +7 -0
- package/dist/extensions/mcp/client/protocol/types.js.map +1 -0
- package/dist/extensions/mcp/client/testing/index.d.ts +2 -0
- package/dist/extensions/mcp/client/testing/index.d.ts.map +1 -0
- package/dist/extensions/mcp/client/testing/index.js +2 -0
- package/dist/extensions/mcp/client/testing/index.js.map +1 -0
- package/dist/extensions/mcp/client/transports/in-memory.d.ts +19 -0
- package/dist/extensions/mcp/client/transports/in-memory.d.ts.map +1 -0
- package/dist/extensions/mcp/client/transports/in-memory.js +50 -0
- package/dist/extensions/mcp/client/transports/in-memory.js.map +1 -0
- package/dist/extensions/mcp/client/transports/stdio.d.ts +32 -0
- package/dist/extensions/mcp/client/transports/stdio.d.ts.map +1 -0
- package/dist/extensions/mcp/client/transports/stdio.js +201 -0
- package/dist/extensions/mcp/client/transports/stdio.js.map +1 -0
- package/dist/extensions/mcp/client/transports/streamable-http.d.ts +96 -0
- package/dist/extensions/mcp/client/transports/streamable-http.d.ts.map +1 -0
- package/dist/extensions/mcp/client/transports/streamable-http.js +456 -0
- package/dist/extensions/mcp/client/transports/streamable-http.js.map +1 -0
- package/dist/extensions/mcp/client/transports/transport.d.ts +28 -0
- package/dist/extensions/mcp/client/transports/transport.d.ts.map +1 -0
- package/dist/extensions/mcp/client/transports/transport.js +38 -0
- package/dist/extensions/mcp/client/transports/transport.js.map +1 -0
- package/dist/extensions/mcp/config.d.ts +72 -0
- package/dist/extensions/mcp/config.d.ts.map +1 -0
- package/dist/extensions/mcp/config.js +158 -0
- package/dist/extensions/mcp/config.js.map +1 -0
- package/dist/extensions/mcp/index.d.ts +76 -0
- package/dist/extensions/mcp/index.d.ts.map +1 -0
- package/dist/extensions/mcp/index.js +1119 -0
- package/dist/extensions/mcp/index.js.map +1 -0
- package/dist/extensions/mcp/log.d.ts +16 -0
- package/dist/extensions/mcp/log.d.ts.map +1 -0
- package/dist/extensions/mcp/log.js +66 -0
- package/dist/extensions/mcp/log.js.map +1 -0
- package/dist/extensions/mcp/oauth.d.ts +103 -0
- package/dist/extensions/mcp/oauth.d.ts.map +1 -0
- package/dist/extensions/mcp/oauth.js +382 -0
- package/dist/extensions/mcp/oauth.js.map +1 -0
- package/dist/extensions/mcp/resources.d.ts +43 -0
- package/dist/extensions/mcp/resources.d.ts.map +1 -0
- package/dist/extensions/mcp/resources.js +262 -0
- package/dist/extensions/mcp/resources.js.map +1 -0
- package/dist/extensions/mcp/runtime.d.ts +104 -0
- package/dist/extensions/mcp/runtime.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.js +546 -0
- package/dist/extensions/mcp/runtime.js.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts +3 -0
- package/dist/extensions/mcp/runtime.lazy.d.ts.map +1 -0
- package/dist/extensions/mcp/runtime.lazy.js +3 -0
- package/dist/extensions/mcp/runtime.lazy.js.map +1 -0
- package/dist/extensions/mcp/tools.d.ts +84 -0
- package/dist/extensions/mcp/tools.d.ts.map +1 -0
- package/dist/extensions/mcp/tools.js +251 -0
- package/dist/extensions/mcp/tools.js.map +1 -0
- package/dist/extensions/mcp/ui.d.ts +60 -0
- package/dist/extensions/mcp/ui.d.ts.map +1 -0
- package/dist/extensions/mcp/ui.js +175 -0
- package/dist/extensions/mcp/ui.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +7 -0
- package/dist/main.js.map +1 -1
- package/docs/extensions/api-reference.md +3 -3
- package/docs/extensions.md +8 -8
- package/docs/mcp-servers.md +153 -79
- package/docs/packages/authoring.md +2 -2
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/dist/builtin/mcp/app-bridge.bundle.js +0 -67
- package/dist/builtin/mcp/xdg-open +0 -1267
package/docs/mcp-servers.md
CHANGED
|
@@ -1,158 +1,232 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "MCP Servers"
|
|
3
|
-
description: "Configure MCP servers, discover tools, and authenticate connections."
|
|
3
|
+
description: "Configure MCP servers, discover tools and resources, and authenticate connections."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# MCP Servers
|
|
7
7
|
|
|
8
|
-
Atomic includes
|
|
8
|
+
Atomic includes [Model Context Protocol](https://modelcontextprotocol.io) support in npm and binary installations. It connects to servers over stdio or streamable HTTP. No separate extension install is needed.
|
|
9
9
|
|
|
10
10
|
## Quick setup
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Add a local server, check the connection, then start Atomic:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
```sh
|
|
15
|
+
atomic mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem .
|
|
16
|
+
atomic mcp list
|
|
17
|
+
atomic
|
|
18
|
+
```
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
For a remote server:
|
|
19
21
|
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
"mcpServers": {
|
|
23
|
-
"my-server": {
|
|
24
|
-
"command": "path/to/mcp-server",
|
|
25
|
-
"args": []
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
22
|
+
```sh
|
|
23
|
+
atomic mcp add docs --url https://example.com/mcp --bearer-token-env-var DOCS_TOKEN
|
|
29
24
|
```
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
Commands write user-level configuration by default. Add `--local` or `-l` to write `.atomic/mcp.json` in the current project instead. Start Atomic and grant project trust before using project servers.
|
|
27
|
+
|
|
28
|
+
Use `/mcp` to inspect connections and manage servers. After changing configuration outside the session, run `/reload` or restart Atomic.
|
|
29
|
+
|
|
30
|
+
## Configure servers
|
|
31
|
+
|
|
32
|
+
Atomic reads user-level servers from `~/.atomic/agent/mcp.json` and project servers from `.atomic/mcp.json`. Project configuration is read only after [project trust](/security) is granted. A project entry replaces a user-level entry with the same name.
|
|
33
|
+
|
|
34
|
+
Both files use a top-level `mcpServers` object. Keep personal servers and credentials in the user-level file. `ATOMIC_CODING_AGENT_DIR` relocates the Atomic agent directory.
|
|
35
|
+
|
|
36
|
+
Stdio servers use `command`, `args`, `env`, and `cwd`. `command` is one executable, not a shell command string. Relative `cwd` values resolve against the session directory.
|
|
37
|
+
|
|
38
|
+
HTTP servers use `url`, optional `headers`, and optional `oauth`. For bearer authentication:
|
|
32
39
|
|
|
33
40
|
```json
|
|
34
41
|
{
|
|
35
42
|
"mcpServers": {
|
|
36
|
-
"
|
|
37
|
-
"url": "https://example.com/mcp"
|
|
43
|
+
"docs": {
|
|
44
|
+
"url": "https://example.com/mcp",
|
|
45
|
+
"headers": { "Authorization": "Bearer ${DOCS_TOKEN}" },
|
|
46
|
+
"description": "Search and read the product documentation"
|
|
38
47
|
}
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
```
|
|
42
51
|
|
|
43
|
-
|
|
52
|
+
URLs support `${NAME}` and `$env:NAME` environment references. Atomic resolves them in memory before validating the URL, without rewriting configuration files. `env`, `headers`, and `oauth.clientSecret` support `${NAME}` environment references and whole-value `!command` expressions, for example `"Authorization": "!echo Bearer $(gh auth token)"`. Only use commands from configuration you trust.
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
Both transports support:
|
|
55
|
+
|
|
56
|
+
- `timeout`: per-request inactivity timeout in seconds, default 60. Progress notifications reset it; it is not a total execution deadline.
|
|
57
|
+
- `enabled: false`: keep a server listed without connecting to it.
|
|
58
|
+
- `exposure` and `toolExposure`: control how tools reach the model.
|
|
59
|
+
- `description`: a short server summary for the system prompt, tool search, and `describeNamespace()`. Without it, Atomic uses the first line of server instructions once connected.
|
|
60
|
+
|
|
61
|
+
Server names may contain letters, digits, `_`, and `-`. Names that differ only in `-` and `_` identify the same namespace. Invalid entries are reported and skipped without preventing other servers from connecting.
|
|
62
|
+
|
|
63
|
+
`type` is optional: `command` selects stdio and `url` selects streamable HTTP. If present, it must be `stdio`, `http`, or `streamable-http`. SSE is not supported; use the server's streamable HTTP endpoint, commonly `/mcp` rather than `/sse`.
|
|
48
64
|
|
|
49
|
-
|
|
65
|
+
### Servers from packages and extensions
|
|
50
66
|
|
|
51
|
-
|
|
67
|
+
Installed [packages](/packages/authoring#mcp-servers) and extensions can contribute servers with the same configuration shape. File-configured servers take precedence over contributions with the same normalized name. Project packages load only after the project is trusted.
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
`/mcp` shows each server's source. Enabled-state and exposure changes for file-configured servers are saved without replacing unrelated configuration. Changes to extension-contributed servers apply to the current session.
|
|
54
70
|
|
|
55
|
-
|
|
56
|
-
2. `~/.atomic/agent/mcp.json`, Atomic user-global overrides.
|
|
57
|
-
3. `.mcp.json`, shared project configuration.
|
|
58
|
-
4. `.atomic/mcp.json`, Atomic project overrides.
|
|
71
|
+
## Manage servers
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
`/mcp` opens a server manager with connection state, tool count, exposure, and source. Select a server to inspect tools and connection details, sign in or out, reconnect, enable or disable it, or change exposure. Servers that need attention appear first.
|
|
61
74
|
|
|
62
|
-
|
|
75
|
+
| Command | Action |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `/mcp` | Open the manager in the TUI, or show status outside it. |
|
|
78
|
+
| `/mcp login [server]` | Sign in with OAuth. |
|
|
79
|
+
| `/mcp logout [server]` | Remove stored OAuth credentials. |
|
|
80
|
+
| `/mcp reconnect [server]` | Reconnect a server and refresh its tools. |
|
|
63
81
|
|
|
64
|
-
|
|
82
|
+
Command completion suggests actions and eligible server names. When a server name is omitted, Atomic selects an eligible server when the choice is unambiguous; otherwise it asks you to choose. Session login requires an interactive UI. Shell login opens the browser without starting a session; authenticate before unattended work.
|
|
65
83
|
|
|
66
|
-
|
|
67
|
-
- Remote servers use `url` and optional `headers`. Keep credentials out of shared files; use environment variable references or `bearerTokenEnv` for bearer authentication.
|
|
68
|
-
- Put personal servers and credentials in user-level configuration. Use project configuration only for servers the project requires, in trusted projects.
|
|
69
|
-
- Use `timeoutMs` for the per-request inactivity timeout. Progress notifications reset it.
|
|
84
|
+
Enabled servers connect in the background when a session starts. The first prompt waits up to 10 seconds for servers with `direct` tools. Codemode, tool search, and resource calls wait for the servers they need. A dropped connection reconnects on the next call. Changes announced by a server update the available tools; withdrawn tools become unreachable.
|
|
70
85
|
|
|
71
|
-
###
|
|
86
|
+
### Shell commands
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
Shell commands use file-configured servers and do not load extensions:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
atomic mcp add <server> [options] -- <command> [args...]
|
|
92
|
+
atomic mcp add <server> [options] --url <url>
|
|
93
|
+
atomic mcp remove <server> [-l]
|
|
94
|
+
atomic mcp list [--json]
|
|
95
|
+
atomic mcp login <server> [--timeout <seconds>]
|
|
96
|
+
atomic mcp logout <server>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`add` replaces an existing entry of the same name. `add` and `remove` accept `--local` (`-l`) for the project file. For stdio, use repeatable `--env KEY=VALUE` and `--cwd`. For HTTP, use repeatable `--header KEY=VALUE`, `--bearer-token-env-var NAME`, and `--oauth-client-id`, `--oauth-client-secret`, `--oauth-callback-port`, or `--oauth-client-name`. Both transports accept `--exposure` and `--description`. Run `atomic mcp --help` for usage.
|
|
100
|
+
|
|
101
|
+
`list` connects to enabled servers and reports state, tools, and errors; it exits with status 1 for invalid configuration or an enabled server that is not connected. `--json` produces a machine-readable report. Login waits up to 300 seconds by default; `--timeout` changes that browser-login budget, not the server request timeout. A running session uses new credentials on its next turn.
|
|
102
|
+
|
|
103
|
+
## Find and call tools
|
|
74
104
|
|
|
75
|
-
|
|
105
|
+
Tools are named `mcp__<server>__<tool>`, with punctuation replaced by `_`. Names that collide after normalization receive deterministic hash suffixes. Use names returned by discovery rather than constructing them yourself.
|
|
76
106
|
|
|
77
|
-
|
|
107
|
+
### Control tool exposure
|
|
108
|
+
|
|
109
|
+
| Exposure | Behavior |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `codemode`, the default | Callable from codemode scripts, but not declared to the model or listed in the codemode description. Discover with `searchTools()`, `describeTool()`, or `ALL_TOOLS`. |
|
|
112
|
+
| `deferred` | Not declared until `tool_search` loads a matching tool for the next model call. |
|
|
113
|
+
| `direct` | Declared like a built-in tool and also callable from codemode. |
|
|
114
|
+
| `hidden` | Unreachable. |
|
|
115
|
+
|
|
116
|
+
`codemode-deferred` is accepted as an alias for `codemode`. Atomic activates `codemode` for codemode servers and `tool_search` for deferred servers. Set `"autoEnableCodemode": false` beside `mcpServers` to prevent automatic codemode activation. A project value overrides a user-level value.
|
|
117
|
+
|
|
118
|
+
`toolExposure` overrides individual tools. Keys are original server tool names or patterns where `*` matches any characters. Exact names win; among patterns, the first match wins:
|
|
78
119
|
|
|
79
120
|
```json
|
|
80
121
|
{
|
|
81
122
|
"mcpServers": {
|
|
82
|
-
"
|
|
123
|
+
"github": {
|
|
124
|
+
"url": "https://api.githubcopilot.com/mcp/",
|
|
125
|
+
"exposure": "deferred",
|
|
126
|
+
"toolExposure": {
|
|
127
|
+
"search_code": "direct",
|
|
128
|
+
"get_*": "codemode",
|
|
129
|
+
"delete_*": "hidden"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
83
132
|
}
|
|
84
133
|
}
|
|
85
134
|
```
|
|
86
135
|
|
|
87
|
-
|
|
136
|
+
Codemode and deferred tools can be reached through either indirect mechanism. Server summaries appear in the `mcp_servers` system prompt section. Scripts can read instructions and tool names with `describeNamespace("mcp__github")`.
|
|
88
137
|
|
|
89
|
-
|
|
138
|
+
Codemode receives the complete MCP result, including `content`, `structuredContent`, and `isError`. Text over 20 KB is shortened for the model, with the complete text saved to a temporary file named in the result. Every MCP call passes through Atomic's tool pipeline, including permission hooks.
|
|
90
139
|
|
|
91
|
-
|
|
140
|
+
## Use resources
|
|
92
141
|
|
|
93
|
-
|
|
142
|
+
When a connected server offers resources, Atomic registers:
|
|
94
143
|
|
|
95
|
-
|
|
144
|
+
- `list_mcp_resources`, to list resources. Use `server` for one server and `cursor` for its next page; without `server`, it lists resources across servers.
|
|
145
|
+
- `list_mcp_resource_templates`, to list URI templates.
|
|
146
|
+
- `read_mcp_resource`, to read by `server` and `uri`. Text and images reach the model directly; other binary content is saved to a temporary file.
|
|
96
147
|
|
|
97
|
-
|
|
98
|
-
mcp({ server: "my-server" })
|
|
99
|
-
mcp({ search: "search" })
|
|
100
|
-
mcp({ describe: "my_server_search" })
|
|
101
|
-
mcp({ tool: "my_server_search", args: '{"query":"example"}' })
|
|
102
|
-
```
|
|
148
|
+
These tools reach enabled, non-hidden resource servers. Their exposure is the widest exposure among those servers. Resource links in tool results identify the server and `read_mcp_resource`.
|
|
103
149
|
|
|
104
|
-
|
|
150
|
+
MCP Apps resources (`ui://` URIs or `text/html;profile=mcp-app`) are omitted because Atomic does not render them.
|
|
105
151
|
|
|
106
|
-
|
|
152
|
+
## Authentication
|
|
107
153
|
|
|
108
|
-
|
|
154
|
+
For a remote OAuth server, configure its URL and run `/mcp login my-server`, or select **Sign in** in `/mcp`. Atomic opens the authorization page and displays a clickable URL. If the browser runs on another machine, paste the complete URL it was redirected to into the sign-in prompt. Treat authorization and redirect URLs as sensitive.
|
|
109
155
|
|
|
110
|
-
|
|
156
|
+
Atomic registers OAuth clients as `atomic`, stores credentials in `~/.atomic/agent/mcp-auth.json`, and refreshes tokens when they expire or are rejected. A successful sign-in reconnects the server. If additional scope is required, sign in again. `/mcp logout my-server` or `atomic mcp logout my-server` deletes stored credentials. Old adapter credential files are not imported; sign in through the native client.
|
|
111
157
|
|
|
112
|
-
|
|
158
|
+
OAuth applies to HTTP servers without an `Authorization` header or provider-token configuration. For a pre-registered client:
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"mcpServers": {
|
|
163
|
+
"example": {
|
|
164
|
+
"url": "https://mcp.example.com/mcp",
|
|
165
|
+
"oauth": {
|
|
166
|
+
"clientId": "my-client",
|
|
167
|
+
"clientSecret": "${EXAMPLE_SECRET}",
|
|
168
|
+
"callbackPort": 8765,
|
|
169
|
+
"scope": "read write"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
113
175
|
|
|
114
|
-
For
|
|
176
|
+
`clientSecret` is optional. `callbackPort` uses `http://127.0.0.1:<port>/callback`. For another registered redirect URI, set `callbackUrl`; it must use HTTP on `localhost`, `127.0.0.1`, or `[::1]`. Atomic sends it as written. If it has no port, Atomic adds `callbackPort` or a free port. The URI must match the client's registration.
|
|
115
177
|
|
|
116
|
-
|
|
178
|
+
Use `oauth.clientName` when a server requires a known registration name. Sign out before signing in again to register with a changed name. Use `oauth.scope` for servers that do not advertise their required scopes; later scope requests are added to it.
|
|
117
179
|
|
|
118
|
-
|
|
180
|
+
### Override OAuth authorization server discovery
|
|
119
181
|
|
|
120
|
-
|
|
182
|
+
If a server advertises the wrong authorization server or none, set `oauth.authServerMetadataUrl` to a trusted RFC 8414 or OpenID Connect metadata document:
|
|
121
183
|
|
|
122
184
|
```json
|
|
123
|
-
{
|
|
185
|
+
{
|
|
186
|
+
"mcpServers": {
|
|
187
|
+
"example": {
|
|
188
|
+
"url": "https://mcp.example.com/mcp",
|
|
189
|
+
"oauth": { "authServerMetadataUrl": "https://example.okta.com/.well-known/openid-configuration" }
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
124
193
|
```
|
|
125
194
|
|
|
126
|
-
|
|
195
|
+
Atomic uses the document instead of authorization server discovery and trusts its issuer as configured. Point it only at a document you trust. The URL must use HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
|
|
196
|
+
|
|
197
|
+
Atomic rejects authorization responses whose `iss` names another issuer, before exchanging the code. If the server promises the RFC 9207 issuer parameter, the response must include it. Empty or null optional token and registration fields count as absent. An empty refresh token does not replace a previously stored one, and `expires_in: null` does not immediately expire the access token.
|
|
127
198
|
|
|
128
199
|
### Authenticate with a provider login
|
|
129
200
|
|
|
130
|
-
An HTTP server can use
|
|
201
|
+
An HTTP server can use your current provider login token instead of MCP OAuth:
|
|
131
202
|
|
|
132
203
|
```json
|
|
133
204
|
{ "mcpServers": { "radius": { "url": "https://radius.example/mcp", "auth": { "provider": "radius" } } } }
|
|
134
205
|
```
|
|
135
206
|
|
|
136
|
-
Atomic reads the
|
|
207
|
+
Atomic reads the current token for every request and does not copy it into MCP credential storage. If the token is missing or rejected, run `/login <provider>` and retry the MCP call.
|
|
208
|
+
|
|
209
|
+
Because the credential goes to the configured server, provider-token authentication has these limits:
|
|
210
|
+
|
|
211
|
+
- It is accepted only from global configuration and extension registrations, not project configuration or package manifests.
|
|
212
|
+
- The URL must use HTTPS, except for HTTP on `localhost`, `127.0.0.1`, or `[::1]`.
|
|
213
|
+
- Tokens are sent only to the server's origin. Only same-origin `307` and `308` redirects are followed.
|
|
137
214
|
|
|
138
|
-
|
|
215
|
+
## Native configuration only
|
|
139
216
|
|
|
140
|
-
|
|
217
|
+
The old adapter has been replaced by the native client. Only `~/.atomic/agent/mcp.json` and trusted `.atomic/mcp.json` files are read; shared configuration files and client imports are not supported. Use the native fields documented above. Old adapter fields are not translated, and old OAuth credential files are not imported.
|
|
141
218
|
|
|
142
|
-
|
|
143
|
-
- The URL must use `https`, or `http` on `localhost`, `127.0.0.1`, or `[::1]`.
|
|
144
|
-
- Atomic sends the token only to the server's origin. It follows `307` and `308` redirects within that origin and refuses every other redirect.
|
|
219
|
+
Tools use `mcp__<server>__<tool>` names and default to `codemode` exposure. The old gateway tool, configurable prefixes, lazy/idle lifecycle settings, metadata cache, SSE transport, MCP Apps rendering, and setup command are not available. All enabled servers connect in the background.
|
|
145
220
|
|
|
146
221
|
## Troubleshooting
|
|
147
222
|
|
|
148
|
-
- Run `/mcp` to
|
|
149
|
-
- After editing configuration
|
|
150
|
-
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
- For slow tools, a server's `timeoutMs` controls the inactivity timeout. Progress notifications reset it; it is not a total execution deadline.
|
|
223
|
+
- Run `/mcp` to inspect connection errors, server tools, and the tail of a failed stdio server's stderr.
|
|
224
|
+
- After editing configuration, run `/reload` or restart Atomic. Use `/mcp reconnect my-server` to retry a connection and refresh tools.
|
|
225
|
+
- For a missing tool, check server and per-tool exposure. `hidden` tools cannot be called; codemode or deferred tools need an active discovery tool.
|
|
226
|
+
- For OAuth redirect failures, check `callbackPort` and `callbackUrl` against the registered URI. Over SSH, paste the complete redirected URL into the waiting sign-in prompt.
|
|
227
|
+
- For an issuer mismatch, check the authorization server's metadata and callback configuration before retrying. Do not disable issuer checks to accept an unexpected response.
|
|
228
|
+
- For slow calls, adjust `timeout` in seconds. Progress resets this inactivity timer.
|
|
155
229
|
|
|
156
230
|
## Local documentation
|
|
157
231
|
|
|
158
|
-
This guide is available at `docs/mcp-servers.md` under Atomic's installation root in
|
|
232
|
+
This guide is available at `docs/mcp-servers.md` under Atomic's installation root in npm and binary installations. The session's documentation instructions provide the absolute docs directory.
|
|
@@ -41,14 +41,14 @@ A package can contribute [MCP servers](/mcp-servers) with `mcpServers`. Point it
|
|
|
41
41
|
{
|
|
42
42
|
"atomic": {
|
|
43
43
|
"mcpServers": {
|
|
44
|
-
"acme-search": { "url": "https://mcp.acme.dev", "
|
|
44
|
+
"acme-search": { "url": "https://mcp.acme.dev", "headers": { "Authorization": "Bearer ${ACME_TOKEN}" } },
|
|
45
45
|
"acme-local": { "command": "node", "args": ["./dist/server.js"], "cwd": "." }
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
Entries use the same schema as `mcp.json`, including
|
|
51
|
+
Entries use the same schema as `mcp.json`, including URL environment-variable interpolation, tool `exposure`, per-tool `toolExposure`, and request `timeout` in seconds. A relative `cwd` is resolved against the package root, so `"cwd": "."` lets a stdio server run files shipped in the package. MCP servers are only read from the manifest, never from a convention directory. Package manifests cannot select provider login credentials with `auth.provider`.
|
|
52
52
|
|
|
53
53
|
Contributed servers have the lowest precedence: users can replace or disable one by name in their own MCP configuration, and filter them with `mcpServers` patterns in settings. Project packages contribute servers only in trusted projects. For a server whose configuration is computed at runtime, call [`pi.registerMcpServer()`](/extensions/api-reference#pi-registermcpserver-name-config) from an extension.
|
|
54
54
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.25-alpha.
|
|
3
|
+
"version": "0.9.25-alpha.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.25-alpha.
|
|
9
|
+
"version": "0.9.25-alpha.4",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.25-alpha.
|
|
13
|
-
"@bastani/pi-ai": "0.9.25-alpha.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.25-alpha.4",
|
|
13
|
+
"@bastani/pi-ai": "0.9.25-alpha.4",
|
|
14
14
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
15
15
|
"@earendil-works/pi-agent-core": "0.99.2",
|
|
16
16
|
"@earendil-works/pi-client": "0.99.2",
|
|
@@ -431,18 +431,18 @@
|
|
|
431
431
|
}
|
|
432
432
|
},
|
|
433
433
|
"node_modules/@bastani/atomic-natives": {
|
|
434
|
-
"version": "0.9.25-alpha.
|
|
435
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.25-alpha.
|
|
434
|
+
"version": "0.9.25-alpha.4",
|
|
435
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.25-alpha.4.tgz",
|
|
436
436
|
"license": "MIT",
|
|
437
437
|
"optionalDependencies": {
|
|
438
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.25-alpha.
|
|
439
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.25-alpha.
|
|
440
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.25-alpha.
|
|
441
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.25-alpha.
|
|
442
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.25-alpha.
|
|
443
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.25-alpha.
|
|
444
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.25-alpha.
|
|
445
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.25-alpha.
|
|
438
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.25-alpha.4",
|
|
439
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.25-alpha.4",
|
|
440
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.25-alpha.4",
|
|
441
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.25-alpha.4",
|
|
442
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.25-alpha.4",
|
|
443
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.25-alpha.4",
|
|
444
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.25-alpha.4",
|
|
445
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.25-alpha.4"
|
|
446
446
|
},
|
|
447
447
|
"engines": {
|
|
448
448
|
"bun": ">=1.4.2",
|
|
@@ -450,8 +450,8 @@
|
|
|
450
450
|
}
|
|
451
451
|
},
|
|
452
452
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
453
|
-
"version": "0.9.25-alpha.
|
|
454
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.25-alpha.
|
|
453
|
+
"version": "0.9.25-alpha.4",
|
|
454
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.25-alpha.4.tgz",
|
|
455
455
|
"license": "MIT",
|
|
456
456
|
"os": [
|
|
457
457
|
"darwin"
|
|
@@ -462,8 +462,8 @@
|
|
|
462
462
|
"optional": true
|
|
463
463
|
},
|
|
464
464
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
465
|
-
"version": "0.9.25-alpha.
|
|
466
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.25-alpha.
|
|
465
|
+
"version": "0.9.25-alpha.4",
|
|
466
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.25-alpha.4.tgz",
|
|
467
467
|
"license": "MIT",
|
|
468
468
|
"os": [
|
|
469
469
|
"darwin"
|
|
@@ -474,8 +474,8 @@
|
|
|
474
474
|
"optional": true
|
|
475
475
|
},
|
|
476
476
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
477
|
-
"version": "0.9.25-alpha.
|
|
478
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.25-alpha.
|
|
477
|
+
"version": "0.9.25-alpha.4",
|
|
478
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.25-alpha.4.tgz",
|
|
479
479
|
"license": "MIT",
|
|
480
480
|
"os": [
|
|
481
481
|
"linux"
|
|
@@ -489,8 +489,8 @@
|
|
|
489
489
|
"optional": true
|
|
490
490
|
},
|
|
491
491
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
492
|
-
"version": "0.9.25-alpha.
|
|
493
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.25-alpha.
|
|
492
|
+
"version": "0.9.25-alpha.4",
|
|
493
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.25-alpha.4.tgz",
|
|
494
494
|
"license": "MIT",
|
|
495
495
|
"os": [
|
|
496
496
|
"linux"
|
|
@@ -504,8 +504,8 @@
|
|
|
504
504
|
"optional": true
|
|
505
505
|
},
|
|
506
506
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
507
|
-
"version": "0.9.25-alpha.
|
|
508
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.25-alpha.
|
|
507
|
+
"version": "0.9.25-alpha.4",
|
|
508
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.25-alpha.4.tgz",
|
|
509
509
|
"license": "MIT",
|
|
510
510
|
"os": [
|
|
511
511
|
"linux"
|
|
@@ -519,8 +519,8 @@
|
|
|
519
519
|
"optional": true
|
|
520
520
|
},
|
|
521
521
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
522
|
-
"version": "0.9.25-alpha.
|
|
523
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.25-alpha.
|
|
522
|
+
"version": "0.9.25-alpha.4",
|
|
523
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.25-alpha.4.tgz",
|
|
524
524
|
"license": "MIT",
|
|
525
525
|
"os": [
|
|
526
526
|
"linux"
|
|
@@ -534,8 +534,8 @@
|
|
|
534
534
|
"optional": true
|
|
535
535
|
},
|
|
536
536
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
537
|
-
"version": "0.9.25-alpha.
|
|
538
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.25-alpha.
|
|
537
|
+
"version": "0.9.25-alpha.4",
|
|
538
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.25-alpha.4.tgz",
|
|
539
539
|
"license": "MIT",
|
|
540
540
|
"os": [
|
|
541
541
|
"win32"
|
|
@@ -546,8 +546,8 @@
|
|
|
546
546
|
"optional": true
|
|
547
547
|
},
|
|
548
548
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
549
|
-
"version": "0.9.25-alpha.
|
|
550
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.25-alpha.
|
|
549
|
+
"version": "0.9.25-alpha.4",
|
|
550
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.25-alpha.4.tgz",
|
|
551
551
|
"license": "MIT",
|
|
552
552
|
"os": [
|
|
553
553
|
"win32"
|
|
@@ -558,8 +558,8 @@
|
|
|
558
558
|
"optional": true
|
|
559
559
|
},
|
|
560
560
|
"node_modules/@bastani/pi-ai": {
|
|
561
|
-
"version": "0.9.25-alpha.
|
|
562
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.25-alpha.
|
|
561
|
+
"version": "0.9.25-alpha.4",
|
|
562
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.25-alpha.4.tgz",
|
|
563
563
|
"license": "MIT",
|
|
564
564
|
"dependencies": {
|
|
565
565
|
"@anthropic-ai/sdk": "0.124.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.25-alpha.
|
|
3
|
+
"version": "0.9.25-alpha.4",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@bastani/atomic-natives": "0.9.25-alpha.
|
|
84
|
-
"@bastani/pi-ai": "0.9.25-alpha.
|
|
83
|
+
"@bastani/atomic-natives": "0.9.25-alpha.4",
|
|
84
|
+
"@bastani/pi-ai": "0.9.25-alpha.4",
|
|
85
85
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
86
86
|
"@earendil-works/pi-agent-core": "0.99.2",
|
|
87
87
|
"@earendil-works/pi-client": "0.99.2",
|