mcp-surfaceprint 0.5.0__tar.gz
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.
- mcp_surfaceprint-0.5.0/LICENSE +21 -0
- mcp_surfaceprint-0.5.0/PKG-INFO +262 -0
- mcp_surfaceprint-0.5.0/README.md +209 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/PKG-INFO +262 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/SOURCES.txt +20 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/dependency_links.txt +1 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/entry_points.txt +2 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/requires.txt +4 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.egg-info/top_level.txt +1 -0
- mcp_surfaceprint-0.5.0/mcp_surfaceprint.py +3077 -0
- mcp_surfaceprint-0.5.0/pyproject.toml +58 -0
- mcp_surfaceprint-0.5.0/setup.cfg +4 -0
- mcp_surfaceprint-0.5.0/tests/test_canonicalization_contract.py +231 -0
- mcp_surfaceprint-0.5.0/tests/test_capabilities.py +355 -0
- mcp_surfaceprint-0.5.0/tests/test_classify_and_signals.py +38 -0
- mcp_surfaceprint-0.5.0/tests/test_cli_behavior.py +298 -0
- mcp_surfaceprint-0.5.0/tests/test_diff_reports.py +561 -0
- mcp_surfaceprint-0.5.0/tests/test_flags_coverage.py +170 -0
- mcp_surfaceprint-0.5.0/tests/test_integration_toy_servers.py +204 -0
- mcp_surfaceprint-0.5.0/tests/test_output_formatting.py +224 -0
- mcp_surfaceprint-0.5.0/tests/test_snapshot_digest.py +191 -0
- mcp_surfaceprint-0.5.0/tests/test_stderr_notes_and_timeouts.py +23 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jordanstarrk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-surfaceprint
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: See what an MCP server exposes before you trust or connect it.
|
|
5
|
+
Author: jordanstarrk
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 jordanstarrk
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/mcp-surfaceprint/mcp-surfaceprint
|
|
29
|
+
Project-URL: Repository, https://github.com/mcp-surfaceprint/mcp-surfaceprint
|
|
30
|
+
Project-URL: Issues, https://github.com/mcp-surfaceprint/mcp-surfaceprint/issues
|
|
31
|
+
Project-URL: Changelog, https://github.com/mcp-surfaceprint/mcp-surfaceprint/releases
|
|
32
|
+
Keywords: mcp,security,cli,ai,agents
|
|
33
|
+
Classifier: Development Status :: 3 - Alpha
|
|
34
|
+
Classifier: Environment :: Console
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Classifier: Programming Language :: Python :: 3
|
|
39
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
44
|
+
Classifier: Topic :: Security
|
|
45
|
+
Classifier: Topic :: Utilities
|
|
46
|
+
Requires-Python: >=3.10
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
License-File: LICENSE
|
|
49
|
+
Requires-Dist: mcp>=1.26.0
|
|
50
|
+
Provides-Extra: test
|
|
51
|
+
Requires-Dist: pytest>=8.0.0; extra == "test"
|
|
52
|
+
Dynamic: license-file
|
|
53
|
+
|
|
54
|
+
# mcp-surfaceprint
|
|
55
|
+
[](https://pepy.tech/project/mcp-surfaceprint)
|
|
56
|
+
[](https://pypi.org/project/mcp-surfaceprint/)
|
|
57
|
+
|
|
58
|
+
Inspect, fingerprint, and diff an MCP server’s declared capability surface.
|
|
59
|
+
|
|
60
|
+
An MCP server can gain tools, parameters, resources, prompts, or new actions beneath an existing tool name. `mcp-surfaceprint` captures that client-visible surface as a deterministic snapshot, computes a stable digest when inspection is complete, and shows structural differences over time.
|
|
61
|
+
|
|
62
|
+
Use it as:
|
|
63
|
+
|
|
64
|
+
- an interface compatibility check for MCP server maintainers
|
|
65
|
+
- a capability-change review gate for teams consuming third-party MCP servers
|
|
66
|
+
|
|
67
|
+
If you want the deeper framing and experiments, see [You can’t prove an MCP server hasn’t changed](You%20can%E2%80%99t%20prove%20an%20MCP%20server%20hasn%E2%80%99t%20changed.md).
|
|
68
|
+
|
|
69
|
+
## Why
|
|
70
|
+
|
|
71
|
+
You review an MCP server before installing it. Later, a dependency upgrade adds a destructive action beneath an existing tool name. The package version changed, but nothing gives you a durable, structural record of the declared capability surface you previously reviewed.
|
|
72
|
+
|
|
73
|
+
`mcp-surfaceprint` turns that declaration into a versioned artifact that can be committed, compared, and reviewed.
|
|
74
|
+
|
|
75
|
+
## Quick start (snapshot + check)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pipx install mcp-surfaceprint
|
|
79
|
+
|
|
80
|
+
# Commit a baseline snapshot (one-time)
|
|
81
|
+
mcp-surfaceprint --save mcp-surface.json "uv run server.py"
|
|
82
|
+
git add mcp-surface.json
|
|
83
|
+
|
|
84
|
+
# Later, locally or in CI: check the live server against the baseline
|
|
85
|
+
mcp-surfaceprint check mcp-surface.json "uv run server.py"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
A changed surface is not automatically unsafe; `check` turns it into an explicit review event rather than allowing it to pass unnoticed.
|
|
89
|
+
|
|
90
|
+
> **Safety:** This command starts the server locally. MCP discovery does not invoke its declared tools, but a server can execute arbitrary code while handling any request. Use `--isolate-home` to prevent it from using your normal `HOME` and XDG directories; this is not a sandbox.
|
|
91
|
+
|
|
92
|
+
## Example change
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
Surface changed.
|
|
96
|
+
|
|
97
|
+
Tools:
|
|
98
|
+
~ manage_items
|
|
99
|
+
inputSchema.properties.action.enum:
|
|
100
|
+
+ delete
|
|
101
|
+
|
|
102
|
+
Previous: sha256:...
|
|
103
|
+
Current: sha256:...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Structured output:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
mcp-surfaceprint check --json mcp-surface.json "uv run server.py" > check.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## What it captures and compares
|
|
113
|
+
|
|
114
|
+
- Tools, descriptions, and full input schemas
|
|
115
|
+
- Schema fields, required parameters, and enum values, including changes beneath unchanged tool names
|
|
116
|
+
- Resources and resource templates
|
|
117
|
+
- Prompts and prompt arguments
|
|
118
|
+
- Optional per-tool manifest operations for servers that multiplex actions behind one tool (see [docs/server-manifest.md](docs/server-manifest.md))
|
|
119
|
+
|
|
120
|
+
## Integrations
|
|
121
|
+
|
|
122
|
+
The snapshot, surface digest, and structured `check --json` output can be consumed by registries, governance systems, agent runtimes, and security gateways. These systems can anchor approval to a specific observed surface and trigger re-review when that surface changes.
|
|
123
|
+
|
|
124
|
+
`mcp-surfaceprint` supplies the inspection artifact; the consuming system decides whether to allow, block, sandbox, or require approval.
|
|
125
|
+
|
|
126
|
+
## Common workflows
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Inspect (human-readable)
|
|
130
|
+
mcp-surfaceprint "uv run server.py"
|
|
131
|
+
mcp-surfaceprint "npx my-mcp-server"
|
|
132
|
+
mcp-surfaceprint "python3 /path/to/server.py"
|
|
133
|
+
|
|
134
|
+
# Save a snapshot (JSON)
|
|
135
|
+
mcp-surfaceprint --save snapshot.json "uv run server.py"
|
|
136
|
+
|
|
137
|
+
# Check against a baseline snapshot
|
|
138
|
+
mcp-surfaceprint check mcp-surface.json "uv run server.py"
|
|
139
|
+
|
|
140
|
+
# Diff two saved snapshots
|
|
141
|
+
mcp-surfaceprint diff before.json after.json
|
|
142
|
+
|
|
143
|
+
# JSON output
|
|
144
|
+
mcp-surfaceprint --json "uv run server.py"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## CI workflow
|
|
148
|
+
|
|
149
|
+
`check` turns declared-surface changes into an explicit review step, with stable exit codes and optional structured JSON (`--json`).
|
|
150
|
+
|
|
151
|
+
1. Commit a baseline snapshot (one-time).
|
|
152
|
+
2. Run `mcp-surfaceprint check ...` in CI.
|
|
153
|
+
3. If the surface changed, review the diff in the PR and intentionally update the baseline snapshot.
|
|
154
|
+
|
|
155
|
+
Exit codes:
|
|
156
|
+
|
|
157
|
+
- **0 — unchanged**: inspection was complete and the surface digests match
|
|
158
|
+
- **1 — changed**: inspection was complete and the surface digests differ
|
|
159
|
+
- **2 — inspection failed**: timeout, auth required, startup error, etc.
|
|
160
|
+
- **3 — incomplete inspection**: preflight could not establish a comparable surface digest
|
|
161
|
+
- **4 — invalid baseline**: missing/partial baseline, unsupported snapshot version, invalid JSON
|
|
162
|
+
|
|
163
|
+
Machine-readable output:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
mcp-surfaceprint check --json mcp-surface.json "uv run server.py" > check.json
|
|
167
|
+
echo "exit_code=$?"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Snapshots and identity
|
|
171
|
+
|
|
172
|
+
Snapshots separate observation metadata from the declared surface. Only the normalized surface is hashed.
|
|
173
|
+
|
|
174
|
+
A digest is emitted only when every supported identity-bearing discovery section completes successfully. An incomplete inspection produces no digest, rather than claiming a comparable identity.
|
|
175
|
+
|
|
176
|
+
See [Snapshot format and normalization](docs/snapshots.md).
|
|
177
|
+
|
|
178
|
+
## Interactive inspection
|
|
179
|
+
|
|
180
|
+
The interactive inspect output is useful for first-time exploration, debugging, and manual review.
|
|
181
|
+
|
|
182
|
+
<details>
|
|
183
|
+
<summary>Example interactive inspection output</summary>
|
|
184
|
+
|
|
185
|
+
```text
|
|
186
|
+
my-server (MCP 2025-03-26)
|
|
187
|
+
|
|
188
|
+
Caution: the server process runs locally without sandboxing.
|
|
189
|
+
Use --isolate-home to prevent access to your real HOME directory.
|
|
190
|
+
|
|
191
|
+
MCP Tools (client-visible):
|
|
192
|
+
🟢 list_items "List all items in the database"
|
|
193
|
+
🟢 get_item "Get a single item by ID"
|
|
194
|
+
🟡 create_item "Create a new item"
|
|
195
|
+
🟡 update_item "Update an existing item"
|
|
196
|
+
🔴 delete_item "Permanently delete an item"
|
|
197
|
+
|
|
198
|
+
Resources:
|
|
199
|
+
📄 my-server://items
|
|
200
|
+
📄 my-server://items/{id}
|
|
201
|
+
|
|
202
|
+
Additional declared operations (from server manifest, 12 across 3 tools):
|
|
203
|
+
Not represented as separate entries in tools/list.
|
|
204
|
+
These are server-declared actions multiplexed behind the tools above.
|
|
205
|
+
↳ items (8): list, get, create, update, delete, search, export, archive
|
|
206
|
+
↳ reports (3): daily, weekly, monthly
|
|
207
|
+
↳ auth_login (single action)
|
|
208
|
+
|
|
209
|
+
Prompts:
|
|
210
|
+
💬 analyze_items (project_name)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
</details>
|
|
214
|
+
|
|
215
|
+
<details>
|
|
216
|
+
<summary>Auth-gated servers / custom env</summary>
|
|
217
|
+
|
|
218
|
+
Some MCP servers only reveal tools/resources after authentication. `mcp-surfaceprint` does not run login flows, so it may be unable to enumerate some or all of the declared surface until credentials are provided.
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Pass a token via env
|
|
222
|
+
export MCP_SERVER_TOKEN=...
|
|
223
|
+
mcp-surfaceprint "npx -y my-mcp-server"
|
|
224
|
+
|
|
225
|
+
# Point HOME (and XDG_* dirs) somewhere else (useful for servers that read ~/.config, ~/.local, etc.)
|
|
226
|
+
mcp-surfaceprint --home /tmp/mcp-surfaceprint-home "npx -y my-mcp-server"
|
|
227
|
+
|
|
228
|
+
# Isolate HOME entirely to reduce side effects/pollution
|
|
229
|
+
mcp-surfaceprint --isolate-home "npx -y my-mcp-server"
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
</details>
|
|
233
|
+
|
|
234
|
+
<details>
|
|
235
|
+
<summary>Optional heuristic annotations</summary>
|
|
236
|
+
|
|
237
|
+
Interactive inspection can add heuristic signals, including read/write/destructive annotations, based on tool names and descriptions. These are hints only: they are not enforced and do not participate in the surface digest.
|
|
238
|
+
|
|
239
|
+
Disable them with:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
mcp-surfaceprint --no-signals "uv run server.py"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
</details>
|
|
246
|
+
|
|
247
|
+
## Non-goals
|
|
248
|
+
|
|
249
|
+
`mcp-surfaceprint` does not provide sandboxing, policy enforcement, or runtime analysis. It describes the interface a server declares; it does not prove that declaration is truthful, exhaustive, or safe.
|
|
250
|
+
|
|
251
|
+
## Documentation
|
|
252
|
+
|
|
253
|
+
- Snapshots: see [docs/snapshots.md](docs/snapshots.md)
|
|
254
|
+
- Server manifests (optional): see [docs/server-manifest.md](docs/server-manifest.md)
|
|
255
|
+
- Design principles: see [PRINCIPLES.md](PRINCIPLES.md)
|
|
256
|
+
- Deeper framing/experiments: see [You can’t prove an MCP server hasn’t changed](You%20can%E2%80%99t%20prove%20an%20MCP%20server%20hasn%E2%80%99t%20changed.md)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
## Project
|
|
260
|
+
|
|
261
|
+
- Bugs / feature requests: [GitHub Issues](https://github.com/mcp-surfaceprint/mcp-surfaceprint/issues)
|
|
262
|
+
- License: [LICENSE](LICENSE)
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# mcp-surfaceprint
|
|
2
|
+
[](https://pepy.tech/project/mcp-surfaceprint)
|
|
3
|
+
[](https://pypi.org/project/mcp-surfaceprint/)
|
|
4
|
+
|
|
5
|
+
Inspect, fingerprint, and diff an MCP server’s declared capability surface.
|
|
6
|
+
|
|
7
|
+
An MCP server can gain tools, parameters, resources, prompts, or new actions beneath an existing tool name. `mcp-surfaceprint` captures that client-visible surface as a deterministic snapshot, computes a stable digest when inspection is complete, and shows structural differences over time.
|
|
8
|
+
|
|
9
|
+
Use it as:
|
|
10
|
+
|
|
11
|
+
- an interface compatibility check for MCP server maintainers
|
|
12
|
+
- a capability-change review gate for teams consuming third-party MCP servers
|
|
13
|
+
|
|
14
|
+
If you want the deeper framing and experiments, see [You can’t prove an MCP server hasn’t changed](You%20can%E2%80%99t%20prove%20an%20MCP%20server%20hasn%E2%80%99t%20changed.md).
|
|
15
|
+
|
|
16
|
+
## Why
|
|
17
|
+
|
|
18
|
+
You review an MCP server before installing it. Later, a dependency upgrade adds a destructive action beneath an existing tool name. The package version changed, but nothing gives you a durable, structural record of the declared capability surface you previously reviewed.
|
|
19
|
+
|
|
20
|
+
`mcp-surfaceprint` turns that declaration into a versioned artifact that can be committed, compared, and reviewed.
|
|
21
|
+
|
|
22
|
+
## Quick start (snapshot + check)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pipx install mcp-surfaceprint
|
|
26
|
+
|
|
27
|
+
# Commit a baseline snapshot (one-time)
|
|
28
|
+
mcp-surfaceprint --save mcp-surface.json "uv run server.py"
|
|
29
|
+
git add mcp-surface.json
|
|
30
|
+
|
|
31
|
+
# Later, locally or in CI: check the live server against the baseline
|
|
32
|
+
mcp-surfaceprint check mcp-surface.json "uv run server.py"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A changed surface is not automatically unsafe; `check` turns it into an explicit review event rather than allowing it to pass unnoticed.
|
|
36
|
+
|
|
37
|
+
> **Safety:** This command starts the server locally. MCP discovery does not invoke its declared tools, but a server can execute arbitrary code while handling any request. Use `--isolate-home` to prevent it from using your normal `HOME` and XDG directories; this is not a sandbox.
|
|
38
|
+
|
|
39
|
+
## Example change
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Surface changed.
|
|
43
|
+
|
|
44
|
+
Tools:
|
|
45
|
+
~ manage_items
|
|
46
|
+
inputSchema.properties.action.enum:
|
|
47
|
+
+ delete
|
|
48
|
+
|
|
49
|
+
Previous: sha256:...
|
|
50
|
+
Current: sha256:...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Structured output:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
mcp-surfaceprint check --json mcp-surface.json "uv run server.py" > check.json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## What it captures and compares
|
|
60
|
+
|
|
61
|
+
- Tools, descriptions, and full input schemas
|
|
62
|
+
- Schema fields, required parameters, and enum values, including changes beneath unchanged tool names
|
|
63
|
+
- Resources and resource templates
|
|
64
|
+
- Prompts and prompt arguments
|
|
65
|
+
- Optional per-tool manifest operations for servers that multiplex actions behind one tool (see [docs/server-manifest.md](docs/server-manifest.md))
|
|
66
|
+
|
|
67
|
+
## Integrations
|
|
68
|
+
|
|
69
|
+
The snapshot, surface digest, and structured `check --json` output can be consumed by registries, governance systems, agent runtimes, and security gateways. These systems can anchor approval to a specific observed surface and trigger re-review when that surface changes.
|
|
70
|
+
|
|
71
|
+
`mcp-surfaceprint` supplies the inspection artifact; the consuming system decides whether to allow, block, sandbox, or require approval.
|
|
72
|
+
|
|
73
|
+
## Common workflows
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Inspect (human-readable)
|
|
77
|
+
mcp-surfaceprint "uv run server.py"
|
|
78
|
+
mcp-surfaceprint "npx my-mcp-server"
|
|
79
|
+
mcp-surfaceprint "python3 /path/to/server.py"
|
|
80
|
+
|
|
81
|
+
# Save a snapshot (JSON)
|
|
82
|
+
mcp-surfaceprint --save snapshot.json "uv run server.py"
|
|
83
|
+
|
|
84
|
+
# Check against a baseline snapshot
|
|
85
|
+
mcp-surfaceprint check mcp-surface.json "uv run server.py"
|
|
86
|
+
|
|
87
|
+
# Diff two saved snapshots
|
|
88
|
+
mcp-surfaceprint diff before.json after.json
|
|
89
|
+
|
|
90
|
+
# JSON output
|
|
91
|
+
mcp-surfaceprint --json "uv run server.py"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## CI workflow
|
|
95
|
+
|
|
96
|
+
`check` turns declared-surface changes into an explicit review step, with stable exit codes and optional structured JSON (`--json`).
|
|
97
|
+
|
|
98
|
+
1. Commit a baseline snapshot (one-time).
|
|
99
|
+
2. Run `mcp-surfaceprint check ...` in CI.
|
|
100
|
+
3. If the surface changed, review the diff in the PR and intentionally update the baseline snapshot.
|
|
101
|
+
|
|
102
|
+
Exit codes:
|
|
103
|
+
|
|
104
|
+
- **0 — unchanged**: inspection was complete and the surface digests match
|
|
105
|
+
- **1 — changed**: inspection was complete and the surface digests differ
|
|
106
|
+
- **2 — inspection failed**: timeout, auth required, startup error, etc.
|
|
107
|
+
- **3 — incomplete inspection**: preflight could not establish a comparable surface digest
|
|
108
|
+
- **4 — invalid baseline**: missing/partial baseline, unsupported snapshot version, invalid JSON
|
|
109
|
+
|
|
110
|
+
Machine-readable output:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
mcp-surfaceprint check --json mcp-surface.json "uv run server.py" > check.json
|
|
114
|
+
echo "exit_code=$?"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Snapshots and identity
|
|
118
|
+
|
|
119
|
+
Snapshots separate observation metadata from the declared surface. Only the normalized surface is hashed.
|
|
120
|
+
|
|
121
|
+
A digest is emitted only when every supported identity-bearing discovery section completes successfully. An incomplete inspection produces no digest, rather than claiming a comparable identity.
|
|
122
|
+
|
|
123
|
+
See [Snapshot format and normalization](docs/snapshots.md).
|
|
124
|
+
|
|
125
|
+
## Interactive inspection
|
|
126
|
+
|
|
127
|
+
The interactive inspect output is useful for first-time exploration, debugging, and manual review.
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary>Example interactive inspection output</summary>
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
my-server (MCP 2025-03-26)
|
|
134
|
+
|
|
135
|
+
Caution: the server process runs locally without sandboxing.
|
|
136
|
+
Use --isolate-home to prevent access to your real HOME directory.
|
|
137
|
+
|
|
138
|
+
MCP Tools (client-visible):
|
|
139
|
+
🟢 list_items "List all items in the database"
|
|
140
|
+
🟢 get_item "Get a single item by ID"
|
|
141
|
+
🟡 create_item "Create a new item"
|
|
142
|
+
🟡 update_item "Update an existing item"
|
|
143
|
+
🔴 delete_item "Permanently delete an item"
|
|
144
|
+
|
|
145
|
+
Resources:
|
|
146
|
+
📄 my-server://items
|
|
147
|
+
📄 my-server://items/{id}
|
|
148
|
+
|
|
149
|
+
Additional declared operations (from server manifest, 12 across 3 tools):
|
|
150
|
+
Not represented as separate entries in tools/list.
|
|
151
|
+
These are server-declared actions multiplexed behind the tools above.
|
|
152
|
+
↳ items (8): list, get, create, update, delete, search, export, archive
|
|
153
|
+
↳ reports (3): daily, weekly, monthly
|
|
154
|
+
↳ auth_login (single action)
|
|
155
|
+
|
|
156
|
+
Prompts:
|
|
157
|
+
💬 analyze_items (project_name)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
</details>
|
|
161
|
+
|
|
162
|
+
<details>
|
|
163
|
+
<summary>Auth-gated servers / custom env</summary>
|
|
164
|
+
|
|
165
|
+
Some MCP servers only reveal tools/resources after authentication. `mcp-surfaceprint` does not run login flows, so it may be unable to enumerate some or all of the declared surface until credentials are provided.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# Pass a token via env
|
|
169
|
+
export MCP_SERVER_TOKEN=...
|
|
170
|
+
mcp-surfaceprint "npx -y my-mcp-server"
|
|
171
|
+
|
|
172
|
+
# Point HOME (and XDG_* dirs) somewhere else (useful for servers that read ~/.config, ~/.local, etc.)
|
|
173
|
+
mcp-surfaceprint --home /tmp/mcp-surfaceprint-home "npx -y my-mcp-server"
|
|
174
|
+
|
|
175
|
+
# Isolate HOME entirely to reduce side effects/pollution
|
|
176
|
+
mcp-surfaceprint --isolate-home "npx -y my-mcp-server"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
</details>
|
|
180
|
+
|
|
181
|
+
<details>
|
|
182
|
+
<summary>Optional heuristic annotations</summary>
|
|
183
|
+
|
|
184
|
+
Interactive inspection can add heuristic signals, including read/write/destructive annotations, based on tool names and descriptions. These are hints only: they are not enforced and do not participate in the surface digest.
|
|
185
|
+
|
|
186
|
+
Disable them with:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
mcp-surfaceprint --no-signals "uv run server.py"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
</details>
|
|
193
|
+
|
|
194
|
+
## Non-goals
|
|
195
|
+
|
|
196
|
+
`mcp-surfaceprint` does not provide sandboxing, policy enforcement, or runtime analysis. It describes the interface a server declares; it does not prove that declaration is truthful, exhaustive, or safe.
|
|
197
|
+
|
|
198
|
+
## Documentation
|
|
199
|
+
|
|
200
|
+
- Snapshots: see [docs/snapshots.md](docs/snapshots.md)
|
|
201
|
+
- Server manifests (optional): see [docs/server-manifest.md](docs/server-manifest.md)
|
|
202
|
+
- Design principles: see [PRINCIPLES.md](PRINCIPLES.md)
|
|
203
|
+
- Deeper framing/experiments: see [You can’t prove an MCP server hasn’t changed](You%20can%E2%80%99t%20prove%20an%20MCP%20server%20hasn%E2%80%99t%20changed.md)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## Project
|
|
207
|
+
|
|
208
|
+
- Bugs / feature requests: [GitHub Issues](https://github.com/mcp-surfaceprint/mcp-surfaceprint/issues)
|
|
209
|
+
- License: [LICENSE](LICENSE)
|