iqa-mcp 0.1.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.
- iqa_mcp-0.1.0/LICENSE +190 -0
- iqa_mcp-0.1.0/PKG-INFO +110 -0
- iqa_mcp-0.1.0/README.md +93 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/PKG-INFO +110 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/SOURCES.txt +10 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/dependency_links.txt +1 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/entry_points.txt +2 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/requires.txt +2 -0
- iqa_mcp-0.1.0/iqa_mcp.egg-info/top_level.txt +1 -0
- iqa_mcp-0.1.0/pyproject.toml +29 -0
- iqa_mcp-0.1.0/server.py +123 -0
- iqa_mcp-0.1.0/setup.cfg +4 -0
iqa_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
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,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 RTTP & IQA Organization
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
iqa_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iqa-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: IQA attestation primitives (derived intent addressing + AE-128 envelope verification) as Model Context Protocol tools. Offline, fail-closed, stateless.
|
|
5
|
+
Author: RTTP & IQA Organization
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/Aicent-Stack/iqa-mcp
|
|
8
|
+
Project-URL: Repository, https://github.com/Aicent-Stack/iqa-mcp
|
|
9
|
+
Project-URL: Public record, https://iqa.org/MCP/
|
|
10
|
+
Keywords: mcp,iqa,rttp,attestation,agents,offline
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: iqa-org>=1.3.1
|
|
15
|
+
Requires-Dist: mcp>=2.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# iqa-mcp
|
|
19
|
+
|
|
20
|
+
The IQA attestation primitives — derived intent addressing and AE-128
|
|
21
|
+
envelope verification — exposed as [Model Context Protocol](https://modelcontextprotocol.io)
|
|
22
|
+
tools, so any MCP agent (Claude Desktop, Cline, your own client, an
|
|
23
|
+
Uber-style MCP Gateway) can verify trust **offline, fail-closed**.
|
|
24
|
+
|
|
25
|
+
A thin, stateless wrapper around the published
|
|
26
|
+
[`iqa-org`](https://pypi.org/project/iqa-org/1.3.1/) 1.3.1 reference
|
|
27
|
+
implementation. No network. No accounts. No key storage. No state.
|
|
28
|
+
|
|
29
|
+
## Tools
|
|
30
|
+
|
|
31
|
+
| Tool | Input | Returns | Key needed |
|
|
32
|
+
|------|-------|---------|------------|
|
|
33
|
+
| `derive_route_shard` | authority string | `SHA-256(authority)[0:16]` hex — the derived, action-independent intent address | no |
|
|
34
|
+
| `parse_envelope` | AE-128 frame hex | structural decode: version, lease, shard, organ, nonce, standing — fails closed on every layout rule | no |
|
|
35
|
+
| `verify_envelope` | frame hex + organ key | full verification: constant-time HMAC-SHA256 over the whole 128-byte frame (attestation zeroed) + lease check. **REJECT is a result, not an error** | yes (caller-supplied) |
|
|
36
|
+
| `published_vector` | — | the published AE128-VECTOR-1 (authority, test key, frame hex) for byte-for-byte self-test | — |
|
|
37
|
+
|
|
38
|
+
## Run
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install "iqa-org>=1.3.1" "mcp>=2"
|
|
42
|
+
python server.py # stdio transport
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
MCP client configuration (Claude Desktop / Cline style):
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"iqa": {
|
|
51
|
+
"command": "python",
|
|
52
|
+
"args": ["/path/to/server.py"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Self-test
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python test_mcp.py
|
|
62
|
+
# [PASS] 1 · list_tools -> 4 tools
|
|
63
|
+
# [PASS] 2 · derive_route_shard -> 5c378581f92754d0bc88adaed84b7c5a
|
|
64
|
+
# [PASS] 3 · published_vector -> f3b2a1c4.pillar.example
|
|
65
|
+
# [PASS] 4 · parse_envelope -> standing radiant
|
|
66
|
+
# [PASS] 5 · verify_envelope -> [PASS] radiant · nonce 1
|
|
67
|
+
# [PASS] 6 · tampered frame -> REJECT (HMAC mismatch)
|
|
68
|
+
# [PASS] 7 · malformed hex -> REJECT
|
|
69
|
+
# ALL 7/7 PASS
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Test 6 is the point: **flip one byte of the standing field and the
|
|
73
|
+
frame dies** — attestation does not verify. Fail-closed, over the wire.
|
|
74
|
+
|
|
75
|
+
## Why
|
|
76
|
+
|
|
77
|
+
Agent platforms are converging on MCP as the tool-calling layer
|
|
78
|
+
(Microsoft's agent OS, Google's Antigravity, Uber's MCP Gateway with
|
|
79
|
+
800+ servers and 5000+ tools). The missing layer is trust semantics:
|
|
80
|
+
*what intent is being addressed* and *whether the counterparty has
|
|
81
|
+
standing* — verifiable without a network call. These four tools make
|
|
82
|
+
that layer native to any MCP agent.
|
|
83
|
+
|
|
84
|
+
Design invariants, inherited from the schemes:
|
|
85
|
+
|
|
86
|
+
- **Zero-parser**: fixed offsets, no TLV, no heap-shaped parsing.
|
|
87
|
+
- **Fail-closed**: malformed input is a REJECT result, never a
|
|
88
|
+
normalised partial answer.
|
|
89
|
+
- **Offline**: verification needs the frame, the key, and a hash
|
|
90
|
+
function. Nothing else.
|
|
91
|
+
- **Stateless**: the server stores nothing; the organ key is passed
|
|
92
|
+
per call by the client and never persisted.
|
|
93
|
+
|
|
94
|
+
## Status
|
|
95
|
+
|
|
96
|
+
Working implementation, protocol-tested (stdio, MCP 2.x SDK). Not yet
|
|
97
|
+
published to PyPI as its own distribution — packaging/registry
|
|
98
|
+
placement is a pending decision. The underlying schemes are
|
|
99
|
+
`iqa-org` 1.3.1 (four registries) with the merged Internet-Draft
|
|
100
|
+
`draft-li-rttp-iqa-addressing-00` in Independent Submission review.
|
|
101
|
+
|
|
102
|
+
## Public record
|
|
103
|
+
|
|
104
|
+
Everything this tool wraps is public and checkable — no asking us:
|
|
105
|
+
|
|
106
|
+
- **Public record, dated**: <https://iqa.org/brief/>
|
|
107
|
+
- **Live demos** — the audit chain this tool joins: <https://iqa.org/demo/compare/> · <https://iqa.org/demo/delegation/>
|
|
108
|
+
- **Whitepaper**: <https://iqa.org/whitepaper/> (also at [rttp.com/whitepaper](https://rttp.com/whitepaper/))
|
|
109
|
+
- **Internet-Draft**: [draft-li-rttp-iqa-addressing](https://datatracker.ietf.org/doc/draft-li-rttp-iqa-addressing/) — Independent Submission, in review
|
|
110
|
+
- **The library this server wraps**: [iqa-org 1.3.1 on PyPI](https://pypi.org/project/iqa-org/1.3.1/) — four registries, byte-exact vectors, offline self-test
|
iqa_mcp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# iqa-mcp
|
|
2
|
+
|
|
3
|
+
The IQA attestation primitives — derived intent addressing and AE-128
|
|
4
|
+
envelope verification — exposed as [Model Context Protocol](https://modelcontextprotocol.io)
|
|
5
|
+
tools, so any MCP agent (Claude Desktop, Cline, your own client, an
|
|
6
|
+
Uber-style MCP Gateway) can verify trust **offline, fail-closed**.
|
|
7
|
+
|
|
8
|
+
A thin, stateless wrapper around the published
|
|
9
|
+
[`iqa-org`](https://pypi.org/project/iqa-org/1.3.1/) 1.3.1 reference
|
|
10
|
+
implementation. No network. No accounts. No key storage. No state.
|
|
11
|
+
|
|
12
|
+
## Tools
|
|
13
|
+
|
|
14
|
+
| Tool | Input | Returns | Key needed |
|
|
15
|
+
|------|-------|---------|------------|
|
|
16
|
+
| `derive_route_shard` | authority string | `SHA-256(authority)[0:16]` hex — the derived, action-independent intent address | no |
|
|
17
|
+
| `parse_envelope` | AE-128 frame hex | structural decode: version, lease, shard, organ, nonce, standing — fails closed on every layout rule | no |
|
|
18
|
+
| `verify_envelope` | frame hex + organ key | full verification: constant-time HMAC-SHA256 over the whole 128-byte frame (attestation zeroed) + lease check. **REJECT is a result, not an error** | yes (caller-supplied) |
|
|
19
|
+
| `published_vector` | — | the published AE128-VECTOR-1 (authority, test key, frame hex) for byte-for-byte self-test | — |
|
|
20
|
+
|
|
21
|
+
## Run
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install "iqa-org>=1.3.1" "mcp>=2"
|
|
25
|
+
python server.py # stdio transport
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
MCP client configuration (Claude Desktop / Cline style):
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"iqa": {
|
|
34
|
+
"command": "python",
|
|
35
|
+
"args": ["/path/to/server.py"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Self-test
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python test_mcp.py
|
|
45
|
+
# [PASS] 1 · list_tools -> 4 tools
|
|
46
|
+
# [PASS] 2 · derive_route_shard -> 5c378581f92754d0bc88adaed84b7c5a
|
|
47
|
+
# [PASS] 3 · published_vector -> f3b2a1c4.pillar.example
|
|
48
|
+
# [PASS] 4 · parse_envelope -> standing radiant
|
|
49
|
+
# [PASS] 5 · verify_envelope -> [PASS] radiant · nonce 1
|
|
50
|
+
# [PASS] 6 · tampered frame -> REJECT (HMAC mismatch)
|
|
51
|
+
# [PASS] 7 · malformed hex -> REJECT
|
|
52
|
+
# ALL 7/7 PASS
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Test 6 is the point: **flip one byte of the standing field and the
|
|
56
|
+
frame dies** — attestation does not verify. Fail-closed, over the wire.
|
|
57
|
+
|
|
58
|
+
## Why
|
|
59
|
+
|
|
60
|
+
Agent platforms are converging on MCP as the tool-calling layer
|
|
61
|
+
(Microsoft's agent OS, Google's Antigravity, Uber's MCP Gateway with
|
|
62
|
+
800+ servers and 5000+ tools). The missing layer is trust semantics:
|
|
63
|
+
*what intent is being addressed* and *whether the counterparty has
|
|
64
|
+
standing* — verifiable without a network call. These four tools make
|
|
65
|
+
that layer native to any MCP agent.
|
|
66
|
+
|
|
67
|
+
Design invariants, inherited from the schemes:
|
|
68
|
+
|
|
69
|
+
- **Zero-parser**: fixed offsets, no TLV, no heap-shaped parsing.
|
|
70
|
+
- **Fail-closed**: malformed input is a REJECT result, never a
|
|
71
|
+
normalised partial answer.
|
|
72
|
+
- **Offline**: verification needs the frame, the key, and a hash
|
|
73
|
+
function. Nothing else.
|
|
74
|
+
- **Stateless**: the server stores nothing; the organ key is passed
|
|
75
|
+
per call by the client and never persisted.
|
|
76
|
+
|
|
77
|
+
## Status
|
|
78
|
+
|
|
79
|
+
Working implementation, protocol-tested (stdio, MCP 2.x SDK). Not yet
|
|
80
|
+
published to PyPI as its own distribution — packaging/registry
|
|
81
|
+
placement is a pending decision. The underlying schemes are
|
|
82
|
+
`iqa-org` 1.3.1 (four registries) with the merged Internet-Draft
|
|
83
|
+
`draft-li-rttp-iqa-addressing-00` in Independent Submission review.
|
|
84
|
+
|
|
85
|
+
## Public record
|
|
86
|
+
|
|
87
|
+
Everything this tool wraps is public and checkable — no asking us:
|
|
88
|
+
|
|
89
|
+
- **Public record, dated**: <https://iqa.org/brief/>
|
|
90
|
+
- **Live demos** — the audit chain this tool joins: <https://iqa.org/demo/compare/> · <https://iqa.org/demo/delegation/>
|
|
91
|
+
- **Whitepaper**: <https://iqa.org/whitepaper/> (also at [rttp.com/whitepaper](https://rttp.com/whitepaper/))
|
|
92
|
+
- **Internet-Draft**: [draft-li-rttp-iqa-addressing](https://datatracker.ietf.org/doc/draft-li-rttp-iqa-addressing/) — Independent Submission, in review
|
|
93
|
+
- **The library this server wraps**: [iqa-org 1.3.1 on PyPI](https://pypi.org/project/iqa-org/1.3.1/) — four registries, byte-exact vectors, offline self-test
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iqa-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: IQA attestation primitives (derived intent addressing + AE-128 envelope verification) as Model Context Protocol tools. Offline, fail-closed, stateless.
|
|
5
|
+
Author: RTTP & IQA Organization
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/Aicent-Stack/iqa-mcp
|
|
8
|
+
Project-URL: Repository, https://github.com/Aicent-Stack/iqa-mcp
|
|
9
|
+
Project-URL: Public record, https://iqa.org/MCP/
|
|
10
|
+
Keywords: mcp,iqa,rttp,attestation,agents,offline
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: iqa-org>=1.3.1
|
|
15
|
+
Requires-Dist: mcp>=2.0
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# iqa-mcp
|
|
19
|
+
|
|
20
|
+
The IQA attestation primitives — derived intent addressing and AE-128
|
|
21
|
+
envelope verification — exposed as [Model Context Protocol](https://modelcontextprotocol.io)
|
|
22
|
+
tools, so any MCP agent (Claude Desktop, Cline, your own client, an
|
|
23
|
+
Uber-style MCP Gateway) can verify trust **offline, fail-closed**.
|
|
24
|
+
|
|
25
|
+
A thin, stateless wrapper around the published
|
|
26
|
+
[`iqa-org`](https://pypi.org/project/iqa-org/1.3.1/) 1.3.1 reference
|
|
27
|
+
implementation. No network. No accounts. No key storage. No state.
|
|
28
|
+
|
|
29
|
+
## Tools
|
|
30
|
+
|
|
31
|
+
| Tool | Input | Returns | Key needed |
|
|
32
|
+
|------|-------|---------|------------|
|
|
33
|
+
| `derive_route_shard` | authority string | `SHA-256(authority)[0:16]` hex — the derived, action-independent intent address | no |
|
|
34
|
+
| `parse_envelope` | AE-128 frame hex | structural decode: version, lease, shard, organ, nonce, standing — fails closed on every layout rule | no |
|
|
35
|
+
| `verify_envelope` | frame hex + organ key | full verification: constant-time HMAC-SHA256 over the whole 128-byte frame (attestation zeroed) + lease check. **REJECT is a result, not an error** | yes (caller-supplied) |
|
|
36
|
+
| `published_vector` | — | the published AE128-VECTOR-1 (authority, test key, frame hex) for byte-for-byte self-test | — |
|
|
37
|
+
|
|
38
|
+
## Run
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install "iqa-org>=1.3.1" "mcp>=2"
|
|
42
|
+
python server.py # stdio transport
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
MCP client configuration (Claude Desktop / Cline style):
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"iqa": {
|
|
51
|
+
"command": "python",
|
|
52
|
+
"args": ["/path/to/server.py"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Self-test
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python test_mcp.py
|
|
62
|
+
# [PASS] 1 · list_tools -> 4 tools
|
|
63
|
+
# [PASS] 2 · derive_route_shard -> 5c378581f92754d0bc88adaed84b7c5a
|
|
64
|
+
# [PASS] 3 · published_vector -> f3b2a1c4.pillar.example
|
|
65
|
+
# [PASS] 4 · parse_envelope -> standing radiant
|
|
66
|
+
# [PASS] 5 · verify_envelope -> [PASS] radiant · nonce 1
|
|
67
|
+
# [PASS] 6 · tampered frame -> REJECT (HMAC mismatch)
|
|
68
|
+
# [PASS] 7 · malformed hex -> REJECT
|
|
69
|
+
# ALL 7/7 PASS
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Test 6 is the point: **flip one byte of the standing field and the
|
|
73
|
+
frame dies** — attestation does not verify. Fail-closed, over the wire.
|
|
74
|
+
|
|
75
|
+
## Why
|
|
76
|
+
|
|
77
|
+
Agent platforms are converging on MCP as the tool-calling layer
|
|
78
|
+
(Microsoft's agent OS, Google's Antigravity, Uber's MCP Gateway with
|
|
79
|
+
800+ servers and 5000+ tools). The missing layer is trust semantics:
|
|
80
|
+
*what intent is being addressed* and *whether the counterparty has
|
|
81
|
+
standing* — verifiable without a network call. These four tools make
|
|
82
|
+
that layer native to any MCP agent.
|
|
83
|
+
|
|
84
|
+
Design invariants, inherited from the schemes:
|
|
85
|
+
|
|
86
|
+
- **Zero-parser**: fixed offsets, no TLV, no heap-shaped parsing.
|
|
87
|
+
- **Fail-closed**: malformed input is a REJECT result, never a
|
|
88
|
+
normalised partial answer.
|
|
89
|
+
- **Offline**: verification needs the frame, the key, and a hash
|
|
90
|
+
function. Nothing else.
|
|
91
|
+
- **Stateless**: the server stores nothing; the organ key is passed
|
|
92
|
+
per call by the client and never persisted.
|
|
93
|
+
|
|
94
|
+
## Status
|
|
95
|
+
|
|
96
|
+
Working implementation, protocol-tested (stdio, MCP 2.x SDK). Not yet
|
|
97
|
+
published to PyPI as its own distribution — packaging/registry
|
|
98
|
+
placement is a pending decision. The underlying schemes are
|
|
99
|
+
`iqa-org` 1.3.1 (four registries) with the merged Internet-Draft
|
|
100
|
+
`draft-li-rttp-iqa-addressing-00` in Independent Submission review.
|
|
101
|
+
|
|
102
|
+
## Public record
|
|
103
|
+
|
|
104
|
+
Everything this tool wraps is public and checkable — no asking us:
|
|
105
|
+
|
|
106
|
+
- **Public record, dated**: <https://iqa.org/brief/>
|
|
107
|
+
- **Live demos** — the audit chain this tool joins: <https://iqa.org/demo/compare/> · <https://iqa.org/demo/delegation/>
|
|
108
|
+
- **Whitepaper**: <https://iqa.org/whitepaper/> (also at [rttp.com/whitepaper](https://rttp.com/whitepaper/))
|
|
109
|
+
- **Internet-Draft**: [draft-li-rttp-iqa-addressing](https://datatracker.ietf.org/doc/draft-li-rttp-iqa-addressing/) — Independent Submission, in review
|
|
110
|
+
- **The library this server wraps**: [iqa-org 1.3.1 on PyPI](https://pypi.org/project/iqa-org/1.3.1/) — four registries, byte-exact vectors, offline self-test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
server
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "iqa-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "IQA attestation primitives (derived intent addressing + AE-128 envelope verification) as Model Context Protocol tools. Offline, fail-closed, stateless."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "RTTP & IQA Organization" }]
|
|
14
|
+
keywords = ["mcp", "iqa", "rttp", "attestation", "agents", "offline"]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"iqa-org>=1.3.1",
|
|
17
|
+
"mcp>=2.0",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://github.com/Aicent-Stack/iqa-mcp"
|
|
22
|
+
Repository = "https://github.com/Aicent-Stack/iqa-mcp"
|
|
23
|
+
"Public record" = "https://iqa.org/MCP/"
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
iqa-mcp = "server:mcp.run"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools]
|
|
29
|
+
py-modules = ["server"]
|
iqa_mcp-0.1.0/server.py
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""iqa-mcp -- the IQA attestation primitives, exposed as MCP tools.
|
|
2
|
+
|
|
3
|
+
A thin, stateless wrapper around the published ``iqa-org`` reference
|
|
4
|
+
implementation (v1.3.1). Every tool runs offline: no network, no
|
|
5
|
+
accounts, no key storage. Fail-closed: malformed input is a REJECT
|
|
6
|
+
result, never a normalised partial answer.
|
|
7
|
+
|
|
8
|
+
Tools
|
|
9
|
+
-----
|
|
10
|
+
derive_route_shard(authority)
|
|
11
|
+
SHA-256(authority), first 16 bytes, lowercase hex -- the derived,
|
|
12
|
+
action-independent intent address (SPEC sec. 3).
|
|
13
|
+
parse_envelope(envelope_hex)
|
|
14
|
+
Structural decode of one AE-128 frame. No key needed; fails closed
|
|
15
|
+
on every layout rule of the companion draft.
|
|
16
|
+
verify_envelope(envelope_hex, organ_key, now, check_lease)
|
|
17
|
+
Full AE-128 verification: constant-time HMAC over the whole frame
|
|
18
|
+
(attestation zeroed) plus the lease check. REJECT is a result.
|
|
19
|
+
published_vector()
|
|
20
|
+
The published AE128-VECTOR-1 (authority, test key, lease, frame
|
|
21
|
+
hex) so any MCP client can reproduce [PASS] byte for byte.
|
|
22
|
+
|
|
23
|
+
Run
|
|
24
|
+
---
|
|
25
|
+
python server.py # stdio transport
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
import json
|
|
29
|
+
|
|
30
|
+
from mcp.server.mcpserver import MCPServer
|
|
31
|
+
|
|
32
|
+
from iqa import envelope
|
|
33
|
+
from iqa.envelope import (
|
|
34
|
+
VECTOR_1_AUTHORITY,
|
|
35
|
+
VECTOR_1_FRAME_HEX,
|
|
36
|
+
VECTOR_1_KEY,
|
|
37
|
+
VECTOR_1_LEASE,
|
|
38
|
+
VECTOR_1_NONCE,
|
|
39
|
+
VECTOR_1_ORGAN,
|
|
40
|
+
VECTOR_1_STANDING,
|
|
41
|
+
vector_1_frame,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
mcp = MCPServer(
|
|
45
|
+
"iqa",
|
|
46
|
+
title="iqa attestation tools",
|
|
47
|
+
description="Offline, fail-closed IQA attestation primitives: derived intent addressing and AE-128 envelope verification, wrapping the published iqa-org 1.3.1 reference implementation.",
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _decode_hex(envelope_hex: str) -> bytes:
|
|
52
|
+
if not isinstance(envelope_hex, str):
|
|
53
|
+
raise envelope.EnvelopeError("envelope must be a hex string")
|
|
54
|
+
cleaned = envelope_hex.strip().lower().replace(" ", "").replace("\n", "")
|
|
55
|
+
try:
|
|
56
|
+
raw = bytes.fromhex(cleaned)
|
|
57
|
+
except ValueError as exc:
|
|
58
|
+
raise envelope.EnvelopeError(f"invalid hex: {exc}") from exc
|
|
59
|
+
return raw
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _frame_json(frame: dict) -> str:
|
|
63
|
+
out = dict(frame)
|
|
64
|
+
out["intent_shard"] = out["intent_shard"].hex()
|
|
65
|
+
out["attestation"] = out["attestation"].hex()
|
|
66
|
+
return json.dumps(out, indent=2)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@mcp.tool(description="Derive the ROUTE_SHARD / intent shard for an authority: SHA-256 of the exact authority string, first 16 bytes, lowercase hex. Deterministic, offline, action-independent (SPEC sec. 3). No lookup, no registry, no network call.")
|
|
70
|
+
def derive_route_shard(authority: str) -> str:
|
|
71
|
+
"""Derive the ROUTE_SHARD / intent shard for an authority."""
|
|
72
|
+
try:
|
|
73
|
+
return envelope.intent_shard_hex(authority)
|
|
74
|
+
except envelope.EnvelopeError as exc:
|
|
75
|
+
return json.dumps({"ok": False, "reject": str(exc)})
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
@mcp.tool(description="Structural decode of one AE-128 attestation envelope (128 bytes, hex). No organ key needed. Fails closed on every layout rule of the companion draft sec. 2/sec. 4 -- malformed input is never normalised into a partial result.")
|
|
79
|
+
def parse_envelope(envelope_hex: str) -> str:
|
|
80
|
+
"""Structural decode of one AE-128 attestation envelope (128 bytes, hex). No organ key needed. Fails closed on every layout rule of the companion draft sec. 2/sec. 4 -- malformed input is never normalised into a partial result."""
|
|
81
|
+
try:
|
|
82
|
+
frame = envelope.parse(_decode_hex(envelope_hex))
|
|
83
|
+
except envelope.EnvelopeError as exc:
|
|
84
|
+
return json.dumps({"ok": False, "reject": str(exc)})
|
|
85
|
+
return json.dumps({"ok": True, "frame": json.loads(_frame_json(frame))}, indent=2)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@mcp.tool(description="Full AE-128 verification (companion draft sec. 4): constant-time HMAC-SHA256 over the whole 128-byte frame with the attestation field zeroed, plus the optional lease check. organ_key is the organ's shared test/deployment key (this server is stateless and stores nothing). REJECT is a result, not an error: a flipped byte anywhere breaks the MAC.")
|
|
89
|
+
def verify_envelope(envelope_hex: str, organ_key: str, now=None, check_lease: bool = True) -> str:
|
|
90
|
+
"""Full AE-128 verification (companion draft sec. 4): constant-time HMAC-SHA256 over the whole 128-byte frame with the attestation field zeroed, plus the optional lease check. organ_key is the organ's shared test/deployment key (this server is stateless and stores nothing). REJECT is a result, not an error: a flipped byte anywhere breaks the MAC."""
|
|
91
|
+
try:
|
|
92
|
+
raw = _decode_hex(envelope_hex)
|
|
93
|
+
except envelope.EnvelopeError as exc:
|
|
94
|
+
return json.dumps({"ok": False, "reject": str(exc)})
|
|
95
|
+
if now is not None and not isinstance(now, (int, float)):
|
|
96
|
+
return json.dumps({"ok": False, "reject": f"now must be a unix timestamp number, got {type(now).__name__}"})
|
|
97
|
+
ok, reason, frame = envelope.verify(raw, organ_key.encode("ascii"), now=now, check_lease=check_lease)
|
|
98
|
+
if not ok:
|
|
99
|
+
return json.dumps({"ok": False, "reject": reason})
|
|
100
|
+
out = json.loads(_frame_json(frame))
|
|
101
|
+
out["lease_expiry_iso"] = __import__("datetime").datetime.fromtimestamp(
|
|
102
|
+
out["lease_expiry"], __import__("datetime").timezone.utc
|
|
103
|
+
).strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
104
|
+
return json.dumps({"ok": True, "reason": reason, "frame": out}, indent=2)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@mcp.tool(description="Return AE128-VECTOR-1, the published conformance vector (companion draft sec. 6): the example authority, the documented test organ key, the lease, and the full 128-byte frame as hex. Feed these into verify_envelope and you must get [PASS] -- byte for byte, offline.")
|
|
108
|
+
def published_vector() -> str:
|
|
109
|
+
"""Return AE128-VECTOR-1, the published conformance vector (companion draft sec. 6): the example authority, the documented test organ key, the lease, and the full 128-byte frame as hex. Feed these into verify_envelope and you must get [PASS] -- byte for byte, offline."""
|
|
110
|
+
return json.dumps({
|
|
111
|
+
"authority": VECTOR_1_AUTHORITY,
|
|
112
|
+
"organ_key": VECTOR_1_KEY.decode("ascii"),
|
|
113
|
+
"lease_expiry": VECTOR_1_LEASE,
|
|
114
|
+
"standing": VECTOR_1_STANDING,
|
|
115
|
+
"organ": VECTOR_1_ORGAN,
|
|
116
|
+
"nonce": VECTOR_1_NONCE,
|
|
117
|
+
"frame_hex": VECTOR_1_FRAME_HEX,
|
|
118
|
+
"expected": "verify_envelope(frame_hex, organ_key) -> [PASS] standing=Radiant",
|
|
119
|
+
}, indent=2)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
if __name__ == "__main__":
|
|
123
|
+
mcp.run()
|
iqa_mcp-0.1.0/setup.cfg
ADDED