passmcp-sdk 0.0.11__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.
Files changed (65) hide show
  1. passmcp_sdk-0.0.11/LICENSE +73 -0
  2. passmcp_sdk-0.0.11/MANIFEST.in +11 -0
  3. passmcp_sdk-0.0.11/PKG-INFO +230 -0
  4. passmcp_sdk-0.0.11/README.md +206 -0
  5. passmcp_sdk-0.0.11/examples/quickstart.py +63 -0
  6. passmcp_sdk-0.0.11/examples/stdio_server.py +125 -0
  7. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/bad_origin +3 -0
  8. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/crash_bracketed_path +2 -0
  9. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/crash_non_ascii_mcp_name +0 -0
  10. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/get_prm +2 -0
  11. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/initialize +0 -0
  12. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/post_call_name +0 -0
  13. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/post_legacy +0 -0
  14. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/post_list +0 -0
  15. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/post_no_header +0 -0
  16. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/protected_bad_token +4 -0
  17. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_http_handler/protected_ok +4 -0
  18. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/bad_version +1 -0
  19. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/bare_list +1 -0
  20. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/discover +1 -0
  21. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/initialize +1 -0
  22. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/notification +1 -0
  23. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/prompts_get +1 -0
  24. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/resources_read +1 -0
  25. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/tools_call +1 -0
  26. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_jsonrpc/truncated +1 -0
  27. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/asm +1 -0
  28. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/asm_any +1 -0
  29. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/asm_url +1 -0
  30. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/challenge +0 -0
  31. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/crash_bracket_resource +1 -0
  32. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/crash_prm_bracket +1 -0
  33. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/crash_unmatched_bracket +2 -0
  34. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/prm +1 -0
  35. passmcp_sdk-0.0.11/fuzz/corpus/fuzz_oauth/prm_urls +1 -0
  36. passmcp_sdk-0.0.11/fuzz/fuzz_http_handler.py +72 -0
  37. passmcp_sdk-0.0.11/fuzz/fuzz_jsonrpc.py +48 -0
  38. passmcp_sdk-0.0.11/fuzz/fuzz_oauth.py +53 -0
  39. passmcp_sdk-0.0.11/pyproject.toml +55 -0
  40. passmcp_sdk-0.0.11/setup.cfg +4 -0
  41. passmcp_sdk-0.0.11/src/passmcp_sdk/__init__.py +155 -0
  42. passmcp_sdk-0.0.11/src/passmcp_sdk/attestation.py +433 -0
  43. passmcp_sdk-0.0.11/src/passmcp_sdk/client.py +271 -0
  44. passmcp_sdk-0.0.11/src/passmcp_sdk/http_transport.py +391 -0
  45. passmcp_sdk-0.0.11/src/passmcp_sdk/http_wire.py +170 -0
  46. passmcp_sdk-0.0.11/src/passmcp_sdk/oauth.py +298 -0
  47. passmcp_sdk-0.0.11/src/passmcp_sdk/origin.py +53 -0
  48. passmcp_sdk-0.0.11/src/passmcp_sdk/py.typed +2 -0
  49. passmcp_sdk-0.0.11/src/passmcp_sdk/schema.py +145 -0
  50. passmcp_sdk-0.0.11/src/passmcp_sdk/server.py +470 -0
  51. passmcp_sdk-0.0.11/src/passmcp_sdk/stdio.py +164 -0
  52. passmcp_sdk-0.0.11/src/passmcp_sdk/types.py +289 -0
  53. passmcp_sdk-0.0.11/src/passmcp_sdk.egg-info/PKG-INFO +230 -0
  54. passmcp_sdk-0.0.11/src/passmcp_sdk.egg-info/SOURCES.txt +63 -0
  55. passmcp_sdk-0.0.11/src/passmcp_sdk.egg-info/dependency_links.txt +1 -0
  56. passmcp_sdk-0.0.11/src/passmcp_sdk.egg-info/top_level.txt +1 -0
  57. passmcp_sdk-0.0.11/testdata/statement.json +60 -0
  58. passmcp_sdk-0.0.11/tests/test_attestation.py +177 -0
  59. passmcp_sdk-0.0.11/tests/test_conformance_2026.py +250 -0
  60. passmcp_sdk-0.0.11/tests/test_era_selection.py +141 -0
  61. passmcp_sdk-0.0.11/tests/test_fuzz_corpus.py +40 -0
  62. passmcp_sdk-0.0.11/tests/test_fuzz_regressions.py +90 -0
  63. passmcp_sdk-0.0.11/tests/test_mcp.py +294 -0
  64. passmcp_sdk-0.0.11/tests/test_protected_resource_metadata.py +110 -0
  65. passmcp_sdk-0.0.11/tests/test_transports_and_oauth.py +415 -0
@@ -0,0 +1,73 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ # SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # The sdist carries tests/, so it also carries what they read: the
5
+ # attestation fixtures, the example servers and the fuzz targets with
6
+ # their seed corpora. None of it goes into the wheel.
7
+ graft testdata
8
+ graft examples
9
+ graft fuzz
10
+ global-exclude *.py[cod]
11
+ prune **/__pycache__
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: passmcp-sdk
3
+ Version: 0.0.11
4
+ Summary: Apache-2.0 Python MCP client and server SDK with capability-gated 2026-07-28 conformance and offline passmcp attestation verification.
5
+ Author-email: Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/sebastienrousseau/passmcp-sdk-python
8
+ Project-URL: Repository, https://github.com/sebastienrousseau/passmcp-sdk-python
9
+ Project-URL: Documentation, https://satellion.com/passmcp/docs/
10
+ Project-URL: Issues, https://github.com/sebastienrousseau/passmcp-sdk-python/issues
11
+ Keywords: mcp,model-context-protocol,passmcp,in-toto,attestation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Dynamic: license-file
24
+
25
+ <!-- SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastienrousseau@users.noreply.github.com> -->
26
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
27
+
28
+ <h1 align="center">passmcp-sdk-python</h1>
29
+
30
+ <p align="center">
31
+ Apache-2.0 Python MCP client and server SDK (`passmcp-sdk`) with capability-gated `2026-07-28` conformance and offline `passmcp` attestation verification.
32
+ </p>
33
+
34
+ <p align="center">
35
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/passmcp-sdk-python/ci.yml?branch=main&style=for-the-badge" alt="Build: CI status" /></a>
36
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python/releases"><img src="https://img.shields.io/github/v/release/sebastienrousseau/passmcp-sdk-python?style=for-the-badge" alt="Release: latest tag" /></a>
37
+ <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge" alt="License: Apache-2.0" /></a>
38
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python"><img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=for-the-badge" alt="Python 3.11+" /></a>
39
+ </p>
40
+
41
+
42
+ ## Contents
43
+
44
+ - [Install](#install)
45
+ - [Requirements](#requirements)
46
+ - [Quick Start](#quick-start)
47
+ - [The passmcp-sdk-python ecosystem](#the-passmcp-sdk-python-ecosystem)
48
+ - [Capabilities at a glance](#capabilities-at-a-glance)
49
+ - [Ecosystem comparison](#ecosystem-comparison)
50
+ - [Benchmarks](#benchmarks)
51
+ - [Features](#features)
52
+ - [Configuration](#configuration)
53
+ - [Examples](#examples)
54
+ - [When not to use passmcp-sdk-python](#when-not-to-use-passmcp-sdk-python)
55
+ - [Development](#development)
56
+ - [Security](#security)
57
+ - [Documentation](#documentation)
58
+ - [Stability guarantees](#stability-guarantees)
59
+ - [License](#license)
60
+
61
+ ---
62
+
63
+ ## Install
64
+
65
+ ```sh
66
+ pip install passmcp-sdk==0.0.11
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Requirements
72
+
73
+ | Requirement | Floor | Notes |
74
+ | :--- | :--- | :--- |
75
+ | Toolchain | Python 3.11+ | Enforced in `pyproject.toml` and `.github/workflows/ci.yml` |
76
+ | Licence | Apache-2.0 | Safe to embed in proprietary and open-source gateways, agents, and servers |
77
+ | Network | None for verification | Attestation parsing and `covers()` run strictly offline |
78
+
79
+ ---
80
+
81
+ ## Quick Start
82
+
83
+ ```python
84
+ from pathlib import Path
85
+ from passmcp_sdk import McpServer, Tool, parse_statement
86
+
87
+ srv = McpServer(name="billing", version="0.0.11")
88
+ srv.register_tool(
89
+ Tool(name="health", description="Read-only health probe", read_only_hint=True),
90
+ lambda _args: "ok",
91
+ )
92
+
93
+ st = parse_statement(Path("testdata/statement.json").read_bytes())
94
+ assert st.covers("http", "https://mcp.example.com/mcp")
95
+ print(srv.name, st.score_grade)
96
+ ```
97
+
98
+ ---
99
+
100
+ ## The passmcp-sdk-python ecosystem
101
+
102
+ Every component is released at **0.0.11** and moves in lockstep: one version across the family, released together ([docs/ecosystem.md](https://github.com/sebastienrousseau/passmcp/blob/main/docs/ecosystem.md)).
103
+
104
+ | Component | Purpose | Use case |
105
+ | :--- | :--- | :--- |
106
+ | [passmcp](https://github.com/sebastienrousseau/passmcp) | The MCP server diagnostic: checks in nine phases, every finding tied to the request that showed it, signed attestations | Test a server before your agents trust it, and gate it in CI |
107
+ | [passmcp-reporting](https://github.com/sebastienrousseau/passmcp-reporting) | The attestation format, its JSON Schemas and offline verifier, the graph model, and the agentgateway processor | Verify an attestation in a gateway, registry or pipeline |
108
+ | [passmcp-server](https://github.com/sebastienrousseau/passmcp-server) | passmcp's diagnostics as read-only MCP tools | Evaluate a server, or check an attestation, from inside the agent |
109
+ | [passmcp-action](https://github.com/sebastienrousseau/passmcp-action) | passmcp in GitHub Actions and GitLab CI, the image pinned by digest | Fail a build on the findings you choose |
110
+ | [passmcp-graph](https://github.com/sebastienrousseau/passmcp-graph) | A local graph of agents, servers, tools and identities built from attestations | Find inherited risk and over-privilege, and gate on policy |
111
+ | [passmcp-registry](https://github.com/sebastienrousseau/passmcp-registry) | A signed public scorecard of the MCP Registry's remote servers (no run published yet) | Check a public server's standing before connecting to it |
112
+ | [passmcp-lsp](https://github.com/sebastienrousseau/passmcp-lsp) | A language server for MCP artefacts, with check-id hover from the guidance catalogue | Catch mistakes in server.json, tool schemas and client configuration while editing |
113
+ | [passmcp-census](https://github.com/sebastienrousseau/passmcp-census) | The reliability census: methodology, disclosure log and reproduction command (no edition published yet) | Cite ecosystem-wide reliability figures, and reproduce them, once an edition is published |
114
+ | [satellion.com](https://github.com/sebastienrousseau/satellion.github.io) | The website, the Go module paths and the format URIs | Read the manual, and resolve `satellion.com/...` imports |
115
+ | [passmcp-sdk-go](https://github.com/sebastienrousseau/passmcp-sdk-go) | Apache-2.0 Go MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Go that clears passmcp's checks and verifies attestations offline |
116
+ | [passmcp-sdk-python](https://github.com/sebastienrousseau/passmcp-sdk-python) | Apache-2.0 Python MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Python that clears passmcp's checks and verifies attestations offline |
117
+ | [passmcp-sdk-java](https://github.com/sebastienrousseau/passmcp-sdk-java) | Apache-2.0 Java MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Java that clears passmcp's checks and verifies attestations offline |
118
+ | [passmcp-sdk-cpp](https://github.com/sebastienrousseau/passmcp-sdk-cpp) | Apache-2.0 C++20 MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in C++ that clears passmcp's checks and verifies attestations offline |
119
+ | [passmcp-sdk-typescript](https://github.com/sebastienrousseau/passmcp-sdk-typescript) | Apache-2.0 TypeScript MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in TypeScript that clears passmcp's checks and verifies attestations offline |
120
+ | [passmcp-sdk-rust](https://github.com/sebastienrousseau/passmcp-sdk-rust) | Apache-2.0 Rust MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Rust that clears passmcp's checks and verifies attestations offline |
121
+
122
+ ---
123
+
124
+ ## Capabilities at a glance
125
+
126
+ | Area | Capability | Status |
127
+ | :--- | :--- | :--- |
128
+ | Transports | Line-delimited `stdio` (`serve_stdio`, `StdioTransport`) and Streamable HTTP (`StreamableHttpHandler`, WSGI/`BaseHTTPRequestHandler`, `HttpClientTransport`) | Released in `0.0.10` |
129
+ | Protocol | JSON-RPC 2.0 `initialize`, `ping`, stateless `server/discover`, and `2026-07-28` mirrored header validation (`-32020`) | Released in `0.0.10` |
130
+ | Capability & schema gating | Derived `capabilities`, JSON Schema `inputSchema` validation (`-32602`), `structuredContent`, and `-32601` for undeclared RPCs | Released in `0.0.10` |
131
+ | SEP-2164 & SEP-2549 | Missing `resources/read` returns `-32602` + `error.data.uri` (`2026-07-28`); list responses validate & emit `ttlMs` / `cacheScope` | Released in `0.0.10` |
132
+ | Auth, Origin & safety | OAuth 2.1 S256 PKCE, RFC 9728 / RFC 8414 metadata validation, `OriginGuard`, and `readOnlyHint: true` default client policy | Released in `0.0.10` |
133
+ | Attestation | Offline `in-toto` `Statement/v1` (`mcp-evaluation/v1`) SHA-256 / SHA-512 target-descriptor verifier | Released in `0.0.10` |
134
+
135
+ ---
136
+
137
+ ## Ecosystem comparison
138
+
139
+ | Property | `passmcp-sdk-python` | Generic JSON-RPC / default SDK scaffolding |
140
+ | :--- | :--- | :--- |
141
+ | Undeclared capability RPCs | Derived from registered handlers; `-32601` automatically | Often left wired with empty lists or generic `-32603` errors |
142
+ | SEP-2164 & SEP-2549 (`2026-07-28`) | Built into resource reads and list responses | Hand-rolled per server |
143
+ | Client tool safety | Refuses unannotated tools by default (ADR 0004) | Executes any tool unless caller filters |
144
+ | Offline `passmcp` attestation check | Built-in `parse` / `validate` / `covers` / `verdict_for` | Custom SHA-256 + schema glue |
145
+
146
+ ---
147
+
148
+ ## Benchmarks
149
+
150
+ Micro-benchmarks for JSON-RPC dispatch and SHA-256 / SHA-512 statement
151
+ verification are run via `make test` and will be published with hardware notes
152
+ at the first tagged release (`v0.0.10`).
153
+
154
+ ---
155
+
156
+ ## Features
157
+
158
+ - **Server & client symmetry**: build servers that clear `passmcp check` and
159
+ clients that enforce `passmcp` attestations and `readOnlyHint` policies before
160
+ calling tools.
161
+ - **Stateless discovery (`server/discover`)**: one-request discovery of protocol
162
+ revision, server identity, capabilities, tools, resources, templates, and
163
+ prompts.
164
+ - **Zero-network attestation verification**: verifies `in-toto` statements
165
+ against `passmcp-reporting`'s canonical target descriptor format.
166
+
167
+ ---
168
+
169
+ ## Configuration
170
+
171
+ Server and client options are passed explicitly via typed constructors (protocol
172
+ revision, allowed HTTP `Origin` values, SEP-2549 cache hints, and client
173
+ mutation policy) with zero hidden environment-variable magic.
174
+
175
+ ---
176
+
177
+ ## Examples
178
+
179
+ Run `make example` to execute [`examples/quickstart.py`](examples/quickstart.py),
180
+ or spawn [`examples/stdio_server.py`](examples/stdio_server.py) under `passmcp check --stdio`
181
+ (`100/100`, grade `A`, `0` failures, `0` warnings).
182
+
183
+ ---
184
+
185
+ ## When not to use passmcp-sdk-python
186
+
187
+ - **Diagnosing an existing third-party MCP server from the CLI or CI**: use
188
+ [`passmcp`](https://github.com/sebastienrousseau/passmcp) directly.
189
+ - **Verifying DSSE / Sigstore cryptographic signatures**: verify the outer
190
+ envelope with `cosign` or `gh attestation verify` first, then pass the
191
+ verified statement payload to `passmcp-sdk-python`.
192
+
193
+ ---
194
+
195
+ ## Development
196
+
197
+ ```sh
198
+ make check
199
+ ```
200
+
201
+ See [DEVELOPMENT.md](DEVELOPMENT.md) and [CONTRIBUTING.md](CONTRIBUTING.md).
202
+
203
+ ---
204
+
205
+ ## Security
206
+
207
+ See [SECURITY.md](SECURITY.md) for private vulnerability reporting and security
208
+ invariants.
209
+
210
+ ---
211
+
212
+ ## Documentation
213
+
214
+ - [DEVELOPMENT.md](DEVELOPMENT.md)
215
+ - [ADR Index](docs/adr/README.md)
216
+ - [passmcp Ecosystem Manual](https://satellion.com/passmcp/docs/)
217
+
218
+ ---
219
+
220
+ ## Stability guarantees
221
+
222
+ Pre-1.0 versions move in lockstep with `passmcp` by `0.0.1` increments. Any
223
+ change to what attestation verification accepts is treated as a breaking change
224
+ requiring a tracking issue and ADR update.
225
+
226
+ ---
227
+
228
+ ## License
229
+
230
+ Licensed under the [Apache License, Version 2.0](LICENSE).
@@ -0,0 +1,206 @@
1
+ <!-- SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastienrousseau@users.noreply.github.com> -->
2
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
3
+
4
+ <h1 align="center">passmcp-sdk-python</h1>
5
+
6
+ <p align="center">
7
+ Apache-2.0 Python MCP client and server SDK (`passmcp-sdk`) with capability-gated `2026-07-28` conformance and offline `passmcp` attestation verification.
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/sebastienrousseau/passmcp-sdk-python/ci.yml?branch=main&style=for-the-badge" alt="Build: CI status" /></a>
12
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python/releases"><img src="https://img.shields.io/github/v/release/sebastienrousseau/passmcp-sdk-python?style=for-the-badge" alt="Release: latest tag" /></a>
13
+ <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge" alt="License: Apache-2.0" /></a>
14
+ <a href="https://github.com/sebastienrousseau/passmcp-sdk-python"><img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=for-the-badge" alt="Python 3.11+" /></a>
15
+ </p>
16
+
17
+
18
+ ## Contents
19
+
20
+ - [Install](#install)
21
+ - [Requirements](#requirements)
22
+ - [Quick Start](#quick-start)
23
+ - [The passmcp-sdk-python ecosystem](#the-passmcp-sdk-python-ecosystem)
24
+ - [Capabilities at a glance](#capabilities-at-a-glance)
25
+ - [Ecosystem comparison](#ecosystem-comparison)
26
+ - [Benchmarks](#benchmarks)
27
+ - [Features](#features)
28
+ - [Configuration](#configuration)
29
+ - [Examples](#examples)
30
+ - [When not to use passmcp-sdk-python](#when-not-to-use-passmcp-sdk-python)
31
+ - [Development](#development)
32
+ - [Security](#security)
33
+ - [Documentation](#documentation)
34
+ - [Stability guarantees](#stability-guarantees)
35
+ - [License](#license)
36
+
37
+ ---
38
+
39
+ ## Install
40
+
41
+ ```sh
42
+ pip install passmcp-sdk==0.0.11
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Requirements
48
+
49
+ | Requirement | Floor | Notes |
50
+ | :--- | :--- | :--- |
51
+ | Toolchain | Python 3.11+ | Enforced in `pyproject.toml` and `.github/workflows/ci.yml` |
52
+ | Licence | Apache-2.0 | Safe to embed in proprietary and open-source gateways, agents, and servers |
53
+ | Network | None for verification | Attestation parsing and `covers()` run strictly offline |
54
+
55
+ ---
56
+
57
+ ## Quick Start
58
+
59
+ ```python
60
+ from pathlib import Path
61
+ from passmcp_sdk import McpServer, Tool, parse_statement
62
+
63
+ srv = McpServer(name="billing", version="0.0.11")
64
+ srv.register_tool(
65
+ Tool(name="health", description="Read-only health probe", read_only_hint=True),
66
+ lambda _args: "ok",
67
+ )
68
+
69
+ st = parse_statement(Path("testdata/statement.json").read_bytes())
70
+ assert st.covers("http", "https://mcp.example.com/mcp")
71
+ print(srv.name, st.score_grade)
72
+ ```
73
+
74
+ ---
75
+
76
+ ## The passmcp-sdk-python ecosystem
77
+
78
+ Every component is released at **0.0.11** and moves in lockstep: one version across the family, released together ([docs/ecosystem.md](https://github.com/sebastienrousseau/passmcp/blob/main/docs/ecosystem.md)).
79
+
80
+ | Component | Purpose | Use case |
81
+ | :--- | :--- | :--- |
82
+ | [passmcp](https://github.com/sebastienrousseau/passmcp) | The MCP server diagnostic: checks in nine phases, every finding tied to the request that showed it, signed attestations | Test a server before your agents trust it, and gate it in CI |
83
+ | [passmcp-reporting](https://github.com/sebastienrousseau/passmcp-reporting) | The attestation format, its JSON Schemas and offline verifier, the graph model, and the agentgateway processor | Verify an attestation in a gateway, registry or pipeline |
84
+ | [passmcp-server](https://github.com/sebastienrousseau/passmcp-server) | passmcp's diagnostics as read-only MCP tools | Evaluate a server, or check an attestation, from inside the agent |
85
+ | [passmcp-action](https://github.com/sebastienrousseau/passmcp-action) | passmcp in GitHub Actions and GitLab CI, the image pinned by digest | Fail a build on the findings you choose |
86
+ | [passmcp-graph](https://github.com/sebastienrousseau/passmcp-graph) | A local graph of agents, servers, tools and identities built from attestations | Find inherited risk and over-privilege, and gate on policy |
87
+ | [passmcp-registry](https://github.com/sebastienrousseau/passmcp-registry) | A signed public scorecard of the MCP Registry's remote servers (no run published yet) | Check a public server's standing before connecting to it |
88
+ | [passmcp-lsp](https://github.com/sebastienrousseau/passmcp-lsp) | A language server for MCP artefacts, with check-id hover from the guidance catalogue | Catch mistakes in server.json, tool schemas and client configuration while editing |
89
+ | [passmcp-census](https://github.com/sebastienrousseau/passmcp-census) | The reliability census: methodology, disclosure log and reproduction command (no edition published yet) | Cite ecosystem-wide reliability figures, and reproduce them, once an edition is published |
90
+ | [satellion.com](https://github.com/sebastienrousseau/satellion.github.io) | The website, the Go module paths and the format URIs | Read the manual, and resolve `satellion.com/...` imports |
91
+ | [passmcp-sdk-go](https://github.com/sebastienrousseau/passmcp-sdk-go) | Apache-2.0 Go MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Go that clears passmcp's checks and verifies attestations offline |
92
+ | [passmcp-sdk-python](https://github.com/sebastienrousseau/passmcp-sdk-python) | Apache-2.0 Python MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Python that clears passmcp's checks and verifies attestations offline |
93
+ | [passmcp-sdk-java](https://github.com/sebastienrousseau/passmcp-sdk-java) | Apache-2.0 Java MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Java that clears passmcp's checks and verifies attestations offline |
94
+ | [passmcp-sdk-cpp](https://github.com/sebastienrousseau/passmcp-sdk-cpp) | Apache-2.0 C++20 MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in C++ that clears passmcp's checks and verifies attestations offline |
95
+ | [passmcp-sdk-typescript](https://github.com/sebastienrousseau/passmcp-sdk-typescript) | Apache-2.0 TypeScript MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in TypeScript that clears passmcp's checks and verifies attestations offline |
96
+ | [passmcp-sdk-rust](https://github.com/sebastienrousseau/passmcp-sdk-rust) | Apache-2.0 Rust MCP client and server SDK with offline attestation verification (not yet released) | Build an MCP server or client in Rust that clears passmcp's checks and verifies attestations offline |
97
+
98
+ ---
99
+
100
+ ## Capabilities at a glance
101
+
102
+ | Area | Capability | Status |
103
+ | :--- | :--- | :--- |
104
+ | Transports | Line-delimited `stdio` (`serve_stdio`, `StdioTransport`) and Streamable HTTP (`StreamableHttpHandler`, WSGI/`BaseHTTPRequestHandler`, `HttpClientTransport`) | Released in `0.0.10` |
105
+ | Protocol | JSON-RPC 2.0 `initialize`, `ping`, stateless `server/discover`, and `2026-07-28` mirrored header validation (`-32020`) | Released in `0.0.10` |
106
+ | Capability & schema gating | Derived `capabilities`, JSON Schema `inputSchema` validation (`-32602`), `structuredContent`, and `-32601` for undeclared RPCs | Released in `0.0.10` |
107
+ | SEP-2164 & SEP-2549 | Missing `resources/read` returns `-32602` + `error.data.uri` (`2026-07-28`); list responses validate & emit `ttlMs` / `cacheScope` | Released in `0.0.10` |
108
+ | Auth, Origin & safety | OAuth 2.1 S256 PKCE, RFC 9728 / RFC 8414 metadata validation, `OriginGuard`, and `readOnlyHint: true` default client policy | Released in `0.0.10` |
109
+ | Attestation | Offline `in-toto` `Statement/v1` (`mcp-evaluation/v1`) SHA-256 / SHA-512 target-descriptor verifier | Released in `0.0.10` |
110
+
111
+ ---
112
+
113
+ ## Ecosystem comparison
114
+
115
+ | Property | `passmcp-sdk-python` | Generic JSON-RPC / default SDK scaffolding |
116
+ | :--- | :--- | :--- |
117
+ | Undeclared capability RPCs | Derived from registered handlers; `-32601` automatically | Often left wired with empty lists or generic `-32603` errors |
118
+ | SEP-2164 & SEP-2549 (`2026-07-28`) | Built into resource reads and list responses | Hand-rolled per server |
119
+ | Client tool safety | Refuses unannotated tools by default (ADR 0004) | Executes any tool unless caller filters |
120
+ | Offline `passmcp` attestation check | Built-in `parse` / `validate` / `covers` / `verdict_for` | Custom SHA-256 + schema glue |
121
+
122
+ ---
123
+
124
+ ## Benchmarks
125
+
126
+ Micro-benchmarks for JSON-RPC dispatch and SHA-256 / SHA-512 statement
127
+ verification are run via `make test` and will be published with hardware notes
128
+ at the first tagged release (`v0.0.10`).
129
+
130
+ ---
131
+
132
+ ## Features
133
+
134
+ - **Server & client symmetry**: build servers that clear `passmcp check` and
135
+ clients that enforce `passmcp` attestations and `readOnlyHint` policies before
136
+ calling tools.
137
+ - **Stateless discovery (`server/discover`)**: one-request discovery of protocol
138
+ revision, server identity, capabilities, tools, resources, templates, and
139
+ prompts.
140
+ - **Zero-network attestation verification**: verifies `in-toto` statements
141
+ against `passmcp-reporting`'s canonical target descriptor format.
142
+
143
+ ---
144
+
145
+ ## Configuration
146
+
147
+ Server and client options are passed explicitly via typed constructors (protocol
148
+ revision, allowed HTTP `Origin` values, SEP-2549 cache hints, and client
149
+ mutation policy) with zero hidden environment-variable magic.
150
+
151
+ ---
152
+
153
+ ## Examples
154
+
155
+ Run `make example` to execute [`examples/quickstart.py`](examples/quickstart.py),
156
+ or spawn [`examples/stdio_server.py`](examples/stdio_server.py) under `passmcp check --stdio`
157
+ (`100/100`, grade `A`, `0` failures, `0` warnings).
158
+
159
+ ---
160
+
161
+ ## When not to use passmcp-sdk-python
162
+
163
+ - **Diagnosing an existing third-party MCP server from the CLI or CI**: use
164
+ [`passmcp`](https://github.com/sebastienrousseau/passmcp) directly.
165
+ - **Verifying DSSE / Sigstore cryptographic signatures**: verify the outer
166
+ envelope with `cosign` or `gh attestation verify` first, then pass the
167
+ verified statement payload to `passmcp-sdk-python`.
168
+
169
+ ---
170
+
171
+ ## Development
172
+
173
+ ```sh
174
+ make check
175
+ ```
176
+
177
+ See [DEVELOPMENT.md](DEVELOPMENT.md) and [CONTRIBUTING.md](CONTRIBUTING.md).
178
+
179
+ ---
180
+
181
+ ## Security
182
+
183
+ See [SECURITY.md](SECURITY.md) for private vulnerability reporting and security
184
+ invariants.
185
+
186
+ ---
187
+
188
+ ## Documentation
189
+
190
+ - [DEVELOPMENT.md](DEVELOPMENT.md)
191
+ - [ADR Index](docs/adr/README.md)
192
+ - [passmcp Ecosystem Manual](https://satellion.com/passmcp/docs/)
193
+
194
+ ---
195
+
196
+ ## Stability guarantees
197
+
198
+ Pre-1.0 versions move in lockstep with `passmcp` by `0.0.1` increments. Any
199
+ change to what attestation verification accepts is treated as a breaking change
200
+ requiring a tracking issue and ADR update.
201
+
202
+ ---
203
+
204
+ ## License
205
+
206
+ Licensed under the [Apache License, Version 2.0](LICENSE).
@@ -0,0 +1,63 @@
1
+ # SPDX-FileCopyrightText: 2026 Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ """Runnable end-to-end quickstart for passmcp-sdk."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from pathlib import Path
9
+
10
+ from passmcp_sdk import (
11
+ CacheHints,
12
+ McpClient,
13
+ McpServer,
14
+ OriginGuard,
15
+ Policy,
16
+ Resource,
17
+ Tool,
18
+ parse_statement,
19
+ )
20
+
21
+
22
+ def main() -> None:
23
+ repo_root = Path(__file__).resolve().parent.parent
24
+ srv = McpServer(
25
+ name="billing",
26
+ version="0.0.11",
27
+ cache_hints=CacheHints(ttl_ms=60_000, cache_scope="private"),
28
+ origin_guard=OriginGuard(["https://console.example.com"]),
29
+ )
30
+ srv.register_tool(
31
+ Tool(name="health", description="Read-only health probe", read_only_hint=True),
32
+ lambda _args: "ok",
33
+ )
34
+ srv.register_resource(
35
+ Resource(uri="billing://status", name="status", description="Service status"),
36
+ lambda _uri: "healthy",
37
+ )
38
+
39
+ st = parse_statement((repo_root / "testdata" / "statement.json").read_bytes())
40
+ assert st.covers("http", "https://mcp.example.com/mcp")
41
+
42
+ client = McpClient.from_server(
43
+ srv,
44
+ endpoint="https://mcp.example.com/mcp",
45
+ transport_kind="http",
46
+ policy=Policy(
47
+ allow_mutations=False,
48
+ statement=st,
49
+ require_zero_failures=False,
50
+ min_score=80.0,
51
+ required_checks=("auth.unauthenticated_tools",),
52
+ ),
53
+ )
54
+ discovered = client.discover()
55
+ tool_result = client.call_tool("health")
56
+ print(
57
+ f"{srv.name} v{srv.version} revision={discovered['protocolVersion']} "
58
+ f"tool={tool_result['content'][0]['text']} grade={st.score_grade}"
59
+ )
60
+
61
+
62
+ if __name__ == "__main__":
63
+ main()