@lemmaoracle/mcp 0.0.7 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +70 -11
- package/README.md +71 -15
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +16 -13
- package/dist/server.js.map +1 -1
- package/dist/tools/get-circuit.d.ts +1 -1
- package/dist/tools/get-circuit.d.ts.map +1 -1
- package/dist/tools/get-circuit.js +11 -3
- package/dist/tools/get-circuit.js.map +1 -1
- package/dist/tools/get-generator.d.ts +1 -1
- package/dist/tools/get-generator.d.ts.map +1 -1
- package/dist/tools/get-generator.js +10 -3
- package/dist/tools/get-generator.js.map +1 -1
- package/dist/tools/get-proof-status.d.ts.map +1 -1
- package/dist/tools/get-proof-status.js +10 -2
- package/dist/tools/get-proof-status.js.map +1 -1
- package/dist/tools/get-schema.d.ts.map +1 -1
- package/dist/tools/get-schema.js +9 -2
- package/dist/tools/get-schema.js.map +1 -1
- package/dist/tools/query-verified-attributes.d.ts +1 -1
- package/dist/tools/query-verified-attributes.d.ts.map +1 -1
- package/dist/tools/query-verified-attributes.js +37 -10
- package/dist/tools/query-verified-attributes.js.map +1 -1
- package/package.json +3 -2
package/README.ja.md
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
# `@lemmaoracle/mcp`
|
|
2
2
|
|
|
3
|
-
`@lemmaoracle/mcp`
|
|
3
|
+
`@lemmaoracle/mcp` は、AI エージェントが Lemma の検証可能なプロベナンス層に
|
|
4
|
+
アクセスするための **Model Context Protocol (MCP) サーバー**です。
|
|
5
|
+
機密ドキュメントから暗号学的に検証された属性(ゼロ知識証明・選択的開示・
|
|
6
|
+
改ざん検知可能なプロベナンス)を、平文を一切渡さずに問い合わせできます。
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
> **Models change. Proofs remain.**
|
|
9
|
+
|
|
10
|
+
## このパッケージについて
|
|
11
|
+
|
|
12
|
+
これは **MCP サーバー**です。MCP (Model Context Protocol) は、AI エージェントを
|
|
13
|
+
外部ツールやデータソースに接続するためのオープンプロトコルで、Anthropic が
|
|
14
|
+
公開し、現在はコミュニティ標準として維持されています。本パッケージは公式
|
|
15
|
+
**MCP SDK**(`@modelcontextprotocol/sdk`)を使って MCP サーバーを実装し、
|
|
16
|
+
Lemma の検証済み属性 API に対するリードオンリーの **tools** 群を公開します。
|
|
17
|
+
|
|
18
|
+
現行 MVP では **5 つの read tools** を提供しています。**resources** と **prompts**
|
|
19
|
+
は v0.0.x では公開しません。書き込み系 tools(`register_document` /
|
|
20
|
+
`submit_proof`)は Phase 2 で対応予定です。
|
|
21
|
+
|
|
22
|
+
## クイックスタート(Claude Desktop)
|
|
23
|
+
|
|
24
|
+
Claude Desktop の MCP 設定に以下を追加してください:
|
|
6
25
|
|
|
7
26
|
```json
|
|
8
27
|
{
|
|
@@ -18,25 +37,55 @@
|
|
|
18
37
|
}
|
|
19
38
|
```
|
|
20
39
|
|
|
21
|
-
|
|
40
|
+
API キーは https://lemma.frame00.com/ja/services から取得してください。
|
|
41
|
+
`LEMMA_API_BASE` は省略可能です(省略時は本番エンドポイント)。
|
|
42
|
+
|
|
43
|
+
## Glama Inspector で試す
|
|
44
|
+
|
|
45
|
+
Glama のブラウザ内 inspector(または任意の MCP inspector)で動作確認するときは、
|
|
46
|
+
以下のデモキーを利用できます。**read-only かつデモデータに限定**されており、
|
|
47
|
+
[example-x402](https://github.com/lemmaoracle/example-x402) でも同じキーが
|
|
48
|
+
使われています:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
LEMMA_API_KEY=b6363aa6265322ed0d786a11d5b6d3264947052ca72deba4cbe1685d099af892
|
|
52
|
+
LEMMA_API_BASE=https://workers.lemma.workers.dev
|
|
53
|
+
```
|
|
22
54
|
|
|
23
|
-
|
|
55
|
+
本番アクセス用のキーは https://lemma.frame00.com/ja/services から発行依頼できます。
|
|
56
|
+
|
|
57
|
+
## ツール一覧 (MCP tool list)
|
|
58
|
+
|
|
59
|
+
このサーバーが公開する **MCP tools** は以下の通りです(現行 MVP では resources /
|
|
60
|
+
prompts はありません):
|
|
24
61
|
|
|
25
62
|
| ツール | フェーズ | 説明 |
|
|
26
63
|
|---|---|---|
|
|
27
|
-
| `lemma_query_verified_attributes` | MVP | Lemma
|
|
28
|
-
| `lemma_get_schema` | MVP | ID
|
|
29
|
-
| `lemma_get_circuit` | MVP |
|
|
30
|
-
| `lemma_get_generator` | MVP | ID
|
|
64
|
+
| `lemma_query_verified_attributes` | MVP | Lemma から暗号学的に検証された属性を問い合わせる。条件に合致するドキュメントを探す主たる入口として使う |
|
|
65
|
+
| `lemma_get_schema` | MVP | Lemma スキーマ(属性構造)を ID から取得する |
|
|
66
|
+
| `lemma_get_circuit` | MVP | ZK proof 回路(制約 + verifier)を ID から取得する |
|
|
67
|
+
| `lemma_get_generator` | MVP | ドキュメントジェネレータ(入出力仕様)を ID から取得する |
|
|
31
68
|
| `lemma_get_proof_status` | MVP | `verificationId` から proof の検証状態を取得する |
|
|
32
69
|
| `lemma_register_document` | Phase 2 | Lemma に新しいドキュメントを登録する |
|
|
33
70
|
| `lemma_submit_proof` | Phase 2 | 検証用の ZK proof を送信する |
|
|
34
71
|
|
|
35
|
-
|
|
72
|
+
## アーキテクチャ
|
|
73
|
+
|
|
74
|
+
- **MCP サーバー**: 本パッケージ。AI エージェントを Model Context Protocol 経由で Lemma API に接続する。
|
|
75
|
+
- **Lemma API**: Cloudflare Workers 上にデプロイされた REST API。スキーマは [OpenAPI v2](https://github.com/lemmaoracle/lemma/blob/main/packages/spec/openapi.lemma.v2.json) を参照。
|
|
76
|
+
- **MCP SDK**: 公式 [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk)(≥ 1.29)に基づく実装。
|
|
77
|
+
- **ライセンス**: Apache-2.0。
|
|
78
|
+
|
|
79
|
+
## プライバシーとデータ取り扱い
|
|
80
|
+
|
|
81
|
+
Lemma は平文ドキュメントを受信しない設計です。MCP サーバーが Lemma API に
|
|
82
|
+
送るのはコミットメント・ハッシュ・ZK proof のみです。詳細は
|
|
83
|
+
https://lemma.frame00.com/ja/privacy/ を参照してください。
|
|
36
84
|
|
|
37
|
-
##
|
|
85
|
+
## ローカル開発(コントリビュータ向け)
|
|
38
86
|
|
|
39
|
-
|
|
87
|
+
MCP サーバー自体に手を入れる場合は、このモノレポからローカルビルドで
|
|
88
|
+
動かしてください。利用するだけなら上記の `npx` 設定をお使いください。
|
|
40
89
|
|
|
41
90
|
```bash
|
|
42
91
|
git clone https://github.com/lemmaoracle/lemma.git
|
|
@@ -62,3 +111,13 @@ pnpm -F @lemmaoracle/mcp build
|
|
|
62
111
|
```
|
|
63
112
|
|
|
64
113
|
変更したあとは `pnpm -F @lemmaoracle/mcp build` で再ビルドし、Claude Desktop を再起動して接続し直してください。本番以外のエンドポイントに向ける場合は `env` に `"LEMMA_API_BASE": "https://..."` を追加してください。
|
|
114
|
+
|
|
115
|
+
## リソース
|
|
116
|
+
|
|
117
|
+
- ドキュメント: 本 README + [OpenAPI spec](https://github.com/lemmaoracle/lemma/blob/main/packages/spec/openapi.lemma.v2.json)
|
|
118
|
+
- ホームページ: https://lemma.frame00.com/ja
|
|
119
|
+
- Issue: https://github.com/lemmaoracle/lemma/issues
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
🇬🇧 [English README](./README.md)
|
package/README.md
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
# `@lemmaoracle/mcp`
|
|
2
2
|
|
|
3
|
-
`@lemmaoracle/mcp` is the
|
|
3
|
+
`@lemmaoracle/mcp` is the **Model Context Protocol (MCP) server** that gives
|
|
4
|
+
AI agents access to Lemma's verifiable provenance layer — query
|
|
5
|
+
cryptographically verified attributes (zero-knowledge proofs, selective
|
|
6
|
+
disclosure, tamper-evident provenance) from confidential documents without
|
|
7
|
+
ever exposing the plaintext.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
> **Models change. Proofs remain.**
|
|
10
|
+
|
|
11
|
+
## What is this?
|
|
12
|
+
|
|
13
|
+
This is an **MCP server**. MCP (Model Context Protocol) is the open protocol
|
|
14
|
+
for connecting AI agents to external tools and data sources, originally
|
|
15
|
+
released by Anthropic and now maintained as a community standard. This
|
|
16
|
+
package implements an MCP server using the official **MCP SDK**
|
|
17
|
+
(`@modelcontextprotocol/sdk`) and exposes a set of read-only **tools** for
|
|
18
|
+
querying Lemma's verifiable attribute API.
|
|
19
|
+
|
|
20
|
+
The current MVP exposes **5 read tools**. **Resources** and **prompts** are
|
|
21
|
+
not exposed in v0.0.x; write tools (`register_document`, `submit_proof`)
|
|
22
|
+
are planned for Phase 2.
|
|
23
|
+
|
|
24
|
+
## Quick start (Claude Desktop)
|
|
25
|
+
|
|
26
|
+
Add this to your Claude Desktop MCP config:
|
|
6
27
|
|
|
7
28
|
```json
|
|
8
29
|
{
|
|
@@ -18,26 +39,55 @@
|
|
|
18
39
|
}
|
|
19
40
|
```
|
|
20
41
|
|
|
21
|
-
|
|
42
|
+
Get an API key at https://lemma.frame00.com/services. `LEMMA_API_BASE` can
|
|
43
|
+
be omitted (defaults to production endpoint).
|
|
22
44
|
|
|
23
|
-
##
|
|
45
|
+
## Try it in Glama Inspector
|
|
46
|
+
|
|
47
|
+
When trying this server in Glama's in-browser inspector (or any MCP
|
|
48
|
+
inspector), you can use the demo key below. It is **read-only and scoped
|
|
49
|
+
to demo data** (the same key is used by
|
|
50
|
+
[example-x402](https://github.com/lemmaoracle/example-x402)):
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
LEMMA_API_KEY=b6363aa6265322ed0d786a11d5b6d3264947052ca72deba4cbe1685d099af892
|
|
54
|
+
LEMMA_API_BASE=https://workers.lemma.workers.dev
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For production access, request a key at https://lemma.frame00.com/services.
|
|
58
|
+
|
|
59
|
+
## Tools (MCP tool list)
|
|
60
|
+
|
|
61
|
+
This server exposes the following **MCP tools** (no resources or prompts in
|
|
62
|
+
the current MVP):
|
|
24
63
|
|
|
25
64
|
| Tool | Phase | Description |
|
|
26
65
|
|---|---|---|
|
|
27
|
-
| `lemma_query_verified_attributes` | MVP | Query cryptographically verified attributes from Lemma
|
|
28
|
-
| `lemma_get_schema` | MVP | Retrieve schema
|
|
29
|
-
| `lemma_get_circuit` | MVP | Retrieve ZK circuit
|
|
30
|
-
| `lemma_get_generator` | MVP | Retrieve document generator
|
|
31
|
-
| `lemma_get_proof_status` | MVP | Get the verification status of a proof by its verificationId |
|
|
32
|
-
| `lemma_register_document` | Phase 2 | Register a new document on Lemma |
|
|
33
|
-
| `lemma_submit_proof` | Phase 2 | Submit a ZK proof for verification |
|
|
66
|
+
| `lemma_query_verified_attributes` | MVP | Query cryptographically verified attributes from Lemma. Use this as the primary entry point for finding documents whose attributes match given conditions. |
|
|
67
|
+
| `lemma_get_schema` | MVP | Retrieve a Lemma schema (attribute structure) by ID. |
|
|
68
|
+
| `lemma_get_circuit` | MVP | Retrieve a ZK proof circuit (constraints + verifier) by ID. |
|
|
69
|
+
| `lemma_get_generator` | MVP | Retrieve a document generator (input/output spec) by ID. |
|
|
70
|
+
| `lemma_get_proof_status` | MVP | Get the verification status of a proof by its `verificationId`. |
|
|
71
|
+
| `lemma_register_document` | Phase 2 | Register a new document on Lemma. |
|
|
72
|
+
| `lemma_submit_proof` | Phase 2 | Submit a ZK proof for verification. |
|
|
73
|
+
|
|
74
|
+
## Architecture
|
|
34
75
|
|
|
35
|
-
|
|
76
|
+
- **MCP Server**: this package — connects AI agents to the Lemma API via the Model Context Protocol.
|
|
77
|
+
- **Lemma API**: REST surface deployed on Cloudflare Workers, defined by [OpenAPI v2](https://github.com/lemmaoracle/lemma/blob/main/packages/spec/openapi.lemma.v2.json).
|
|
78
|
+
- **MCP SDK**: this server is built on the official [`@modelcontextprotocol/sdk`](https://www.npmjs.com/package/@modelcontextprotocol/sdk) (≥ 1.29).
|
|
79
|
+
- **License**: Apache-2.0.
|
|
36
80
|
|
|
37
|
-
##
|
|
81
|
+
## Privacy & data handling
|
|
38
82
|
|
|
39
|
-
|
|
40
|
-
|
|
83
|
+
Lemma is designed so that we never receive plaintext documents. The MCP
|
|
84
|
+
server only transmits commitments, hashes, and ZK proofs to the Lemma API.
|
|
85
|
+
See https://lemma.frame00.com/privacy for the full privacy policy.
|
|
86
|
+
|
|
87
|
+
## Local development (contributors)
|
|
88
|
+
|
|
89
|
+
For contributors hacking on the MCP server itself, run it from a local
|
|
90
|
+
build of this monorepo. End users should use the `npx` config above.
|
|
41
91
|
|
|
42
92
|
```bash
|
|
43
93
|
git clone https://github.com/lemmaoracle/lemma.git
|
|
@@ -67,6 +117,12 @@ Rebuild after changes with `pnpm -F @lemmaoracle/mcp build` and restart
|
|
|
67
117
|
Claude Desktop to reconnect. To point at a non-production API, add
|
|
68
118
|
`"LEMMA_API_BASE": "https://..."` to `env`.
|
|
69
119
|
|
|
120
|
+
## Resources
|
|
121
|
+
|
|
122
|
+
- Documentation: this README + [OpenAPI spec](https://github.com/lemmaoracle/lemma/blob/main/packages/spec/openapi.lemma.v2.json)
|
|
123
|
+
- Homepage: https://lemma.frame00.com
|
|
124
|
+
- Issues: https://github.com/lemmaoracle/lemma/issues
|
|
125
|
+
|
|
70
126
|
---
|
|
71
127
|
|
|
72
128
|
🇯🇵 [日本語版はこちら / Japanese README](./README.ja.md)
|
package/dist/server.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type LemmaMcpServerConfig = Readonly<{
|
|
|
3
3
|
apiBase?: string;
|
|
4
4
|
apiKey?: string;
|
|
5
5
|
defaultChainId?: number;
|
|
6
|
+
/** Override the version reported via MCP serverInfo. Defaults to PACKAGE_VERSION. */
|
|
7
|
+
version?: string;
|
|
6
8
|
}>;
|
|
7
9
|
export declare const createLemmaMcpServer: (config: LemmaMcpServerConfig) => McpServer;
|
|
8
10
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAsBH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,oBAAoB,KAAG,SAqBnE,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -5,6 +5,13 @@ import { getSchemaTool } from "./tools/get-schema.js";
|
|
|
5
5
|
import { getCircuitTool } from "./tools/get-circuit.js";
|
|
6
6
|
import { getGeneratorTool } from "./tools/get-generator.js";
|
|
7
7
|
import { getProofStatusTool } from "./tools/get-proof-status.js";
|
|
8
|
+
// Keep in sync with packages/mcp/package.json#version. Surfaced via MCP
|
|
9
|
+
// serverInfo.version on initialize handshake; agents and registries (Glama,
|
|
10
|
+
// Smithery) display this. CTO follow-up: replace with build-time injection
|
|
11
|
+
// or a sync hook in publish-npm.sh.
|
|
12
|
+
const PACKAGE_VERSION = "0.0.9";
|
|
13
|
+
/** Register all tools on the server (side effects encapsulated at boundary). */
|
|
14
|
+
const registerTools = (server, client, tools) => tools.reduce((srv, register) => (register(srv, client), srv), server);
|
|
8
15
|
export const createLemmaMcpServer = (config) => {
|
|
9
16
|
const client = create({
|
|
10
17
|
...(config.apiBase !== undefined ? { apiBase: config.apiBase } : {}),
|
|
@@ -13,19 +20,15 @@ export const createLemmaMcpServer = (config) => {
|
|
|
13
20
|
});
|
|
14
21
|
const server = new McpServer({
|
|
15
22
|
name: "@lemmaoracle/mcp",
|
|
16
|
-
version:
|
|
23
|
+
version: config.version ?? PACKAGE_VERSION,
|
|
17
24
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getGeneratorTool(server, client);
|
|
27
|
-
// eslint-disable-next-line functional/no-expression-statements
|
|
28
|
-
getProofStatusTool(server, client);
|
|
29
|
-
return server;
|
|
25
|
+
const tools = [
|
|
26
|
+
queryVerifiedAttributesTool,
|
|
27
|
+
getSchemaTool,
|
|
28
|
+
getCircuitTool,
|
|
29
|
+
getGeneratorTool,
|
|
30
|
+
getProofStatusTool,
|
|
31
|
+
];
|
|
32
|
+
return registerTools(server, client, tools);
|
|
30
33
|
};
|
|
31
34
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version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CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1F,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,eAAe;KAC3C,CAAC,CAAC;IAEH,MAAM,KAAK,GAA4B;QACrC,2BAA2B;QAC3B,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,kBAAkB;KACnB,CAAC;IAEF,OAAO,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import type { RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import type { LemmaClient, CircuitMeta } from "@lemmaoracle/spec";
|
|
4
4
|
export type GetCircuitInput = Readonly<{
|
|
5
|
-
|
|
5
|
+
circuitId: string;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const getCircuit: (client: LemmaClient, input: GetCircuitInput) => Promise<CircuitMeta>;
|
|
8
8
|
export declare const getCircuitTool: (server: McpServer, client: LemmaClient) => RegisteredTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-circuit.d.ts","sourceRoot":"","sources":["../../src/tools/get-circuit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGlE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IAAE,
|
|
1
|
+
{"version":3,"file":"get-circuit.d.ts","sourceRoot":"","sources":["../../src/tools/get-circuit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGlE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE9D,eAAO,MAAM,UAAU,GAAI,QAAQ,WAAW,EAAE,OAAO,eAAe,KAAG,OAAO,CAAC,WAAW,CACjD,CAAC;AAE5C,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,EAAE,QAAQ,WAAW,KAAG,cAmBrE,CAAC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import * as circuits from "@lemmaoracle/sdk/circuits";
|
|
3
3
|
import { runTool } from "../errors.js";
|
|
4
|
-
export const getCircuit = (client, input) => circuits.getById(client, input.
|
|
4
|
+
export const getCircuit = (client, input) => circuits.getById(client, input.circuitId);
|
|
5
5
|
export const getCircuitTool = (server, client) => server.registerTool("lemma_get_circuit", {
|
|
6
|
-
description: "Retrieve
|
|
7
|
-
|
|
6
|
+
description: "Retrieve a zero-knowledge proof circuit by its circuitId via GET /v1/circuits/{circuitId}. " +
|
|
7
|
+
"A circuit defines the constraints that proofs must satisfy and binds to a single schema. " +
|
|
8
|
+
"Returns CircuitMeta { circuitId, schema, description?, inputs?, verifier?: { type: 'onchain'|'offchain', address?, chainId? }, artifact?: { location: { type: 'ipfs'|'https', wasm, zkey } } }. " +
|
|
9
|
+
"Use this before lemma_submit_proof to confirm the circuit's schema, public inputs, and verifier configuration. " +
|
|
10
|
+
"Circuits are immutable; new variants get new circuitIds.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
circuitId: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe("Circuit ID. Returned in the `proof.circuitId` field of VerifiedAttributesQueryResponseItem from lemma_query_verified_attributes, or registered via POST /v1/circuits. NOTE: this matches the OpenAPI field name `circuitId`, not a generic `id`."),
|
|
15
|
+
},
|
|
8
16
|
}, (input) => runTool(getCircuit(client, input)));
|
|
9
17
|
//# sourceMappingURL=get-circuit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-circuit.js","sourceRoot":"","sources":["../../src/tools/get-circuit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAmB,EAAE,KAAsB,EAAwB,EAAE,CAC9F,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"get-circuit.js","sourceRoot":"","sources":["../../src/tools/get-circuit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAmB,EAAE,KAAsB,EAAwB,EAAE,CAC9F,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAiB,EAAE,MAAmB,EAAkB,EAAE,CACvF,MAAM,CAAC,YAAY,CACjB,mBAAmB,EACnB;IACE,WAAW,EACT,6FAA6F;QAC7F,2FAA2F;QAC3F,kMAAkM;QAClM,iHAAiH;QACjH,0DAA0D;IAC5D,WAAW,EAAE;QACX,SAAS,EAAE,CAAC;aACT,MAAM,EAAE;aACR,QAAQ,CACP,kPAAkP,CACnP;KACJ;CACF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC9C,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import type { RegisteredTool } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
import type { LemmaClient, GeneratorMeta } from "@lemmaoracle/spec";
|
|
4
4
|
export type GetGeneratorInput = Readonly<{
|
|
5
|
-
|
|
5
|
+
generatorId: string;
|
|
6
6
|
}>;
|
|
7
7
|
export declare const getGenerator: (client: LemmaClient, input: GetGeneratorInput) => Promise<GeneratorMeta>;
|
|
8
8
|
export declare const getGeneratorTool: (server: McpServer, client: LemmaClient) => RegisteredTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-generator.d.ts","sourceRoot":"","sources":["../../src/tools/get-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IAAE,
|
|
1
|
+
{"version":3,"file":"get-generator.d.ts","sourceRoot":"","sources":["../../src/tools/get-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElE,eAAO,MAAM,YAAY,GAAI,QAAQ,WAAW,EAAE,OAAO,iBAAiB,KAAG,OAAO,CAAC,aAAa,CACnD,CAAC;AAEhD,eAAO,MAAM,gBAAgB,GAAI,QAAQ,SAAS,EAAE,QAAQ,WAAW,KAAG,cAkBvE,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import * as generators from "@lemmaoracle/sdk/generators";
|
|
3
3
|
import { runTool } from "../errors.js";
|
|
4
|
-
export const getGenerator = (client, input) => generators.getById(client, input.
|
|
4
|
+
export const getGenerator = (client, input) => generators.getById(client, input.generatorId);
|
|
5
5
|
export const getGeneratorTool = (server, client) => server.registerTool("lemma_get_generator", {
|
|
6
|
-
description: "Retrieve document generator
|
|
7
|
-
|
|
6
|
+
description: "Retrieve a Lemma document generator by generatorId via GET /v1/doc-generators/{generatorId}. " +
|
|
7
|
+
"A generator describes how a class of source documents is produced (e.g., what fields a 'KYC-v2' issuer must populate). " +
|
|
8
|
+
"Returns GeneratorMeta { generatorId, schema, description?, language?, source?: { type: 'url', uri }, inputsSpec?, outputsSpec? }. " +
|
|
9
|
+
"Each generator is bound to one schema. Use this when onboarding a new issuer or auditing how an existing schema is being populated.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
generatorId: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("Generator ID. Each generator is bound to a single schema and describes how source documents are produced. Registered via POST /v1/doc-generators. NOTE: this matches the OpenAPI field name `generatorId`, not a generic `id`."),
|
|
14
|
+
},
|
|
8
15
|
}, (input) => runTool(getGenerator(client, input)));
|
|
9
16
|
//# sourceMappingURL=get-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-generator.js","sourceRoot":"","sources":["../../src/tools/get-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAmB,EAAE,KAAwB,EAA0B,EAAE,CACpG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"get-generator.js","sourceRoot":"","sources":["../../src/tools/get-generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAmB,EAAE,KAAwB,EAA0B,EAAE,CACpG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAiB,EAAE,MAAmB,EAAkB,EAAE,CACzF,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;IACE,WAAW,EACT,+FAA+F;QAC/F,yHAAyH;QACzH,oIAAoI;QACpI,qIAAqI;IACvI,WAAW,EAAE;QACX,WAAW,EAAE,CAAC;aACX,MAAM,EAAE;aACR,QAAQ,CACP,gOAAgO,CACjO;KACJ;CACF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-proof-status.d.ts","sourceRoot":"","sources":["../../src/tools/get-proof-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,C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getProofStatus = async (client, input) => {
|
|
|
24
24
|
: undefined;
|
|
25
25
|
};
|
|
26
26
|
export const getProofStatusTool = (server, client) => server.registerTool("lemma_get_proof_status", {
|
|
27
|
-
description: "Get the verification status of a proof
|
|
28
|
-
|
|
27
|
+
description: "Get the verification status of a proof. " +
|
|
28
|
+
"NOTE: the v2 API does not yet expose a dedicated GET /v1/proofs/{id} endpoint, so this tool internally calls POST /v1/verified-attributes/query filtered by docHash (treating the verificationId returned from lemma_submit_proof as a docHash filter). " +
|
|
29
|
+
"Returns { status, circuitId, chainId, docHash } extracted from the matched item, or undefined if the verificationId is unknown. " +
|
|
30
|
+
"Status enum: received | verified | onchain-verified | rejected. " +
|
|
31
|
+
"Use the SDK's isVerified() helper (or check status === 'verified' || status === 'onchain-verified') to determine cryptographic validity.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
verificationId: z
|
|
34
|
+
.string()
|
|
35
|
+
.describe("verificationId returned by lemma_submit_proof. Internally treated as a docHash filter on POST /v1/verified-attributes/query (no dedicated GET /v1/proofs/{id} endpoint in v2 API)."),
|
|
36
|
+
},
|
|
29
37
|
}, (input) => runTool(getProofStatus(client, input)));
|
|
30
38
|
//# sourceMappingURL=get-proof-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-proof-status.js","sourceRoot":"","sources":["../../src/tools/get-proof-status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAWvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,MAAmB,EACnB,KAA0B,EACc,EAAE;IAC1C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE;QAC9C,UAAU,EAAE,EAAE;QACd,OAAO,EAAE,KAAK,CAAC,cA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,OAAO,IAAI,KAAK,CAAC,OAAO;YAC9C,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAiB,EAAE,MAAmB,EAAkB,EAAE,CAC3F,MAAM,CAAC,YAAY,CACjB,wBAAwB,EACxB;IACE,WAAW,EACT,0CAA0C;QAC1C,0PAA0P;QAC1P,kIAAkI;QAClI,kEAAkE;QAClE,0IAA0I;IAC5I,WAAW,EAAE;QACX,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,CACP,oLAAoL,CACrL;KACJ;CACF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-schema.d.ts","sourceRoot":"","sources":["../../src/tools/get-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGjE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,eAAO,MAAM,SAAS,GAAI,QAAQ,WAAW,EAAE,OAAO,cAAc,KAAG,OAAO,CAAC,UAAU,CACtD,CAAC;AAEpC,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,EAAE,QAAQ,WAAW,KAAG,
|
|
1
|
+
{"version":3,"file":"get-schema.d.ts","sourceRoot":"","sources":["../../src/tools/get-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGjE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,eAAO,MAAM,SAAS,GAAI,QAAQ,WAAW,EAAE,OAAO,cAAc,KAAG,OAAO,CAAC,UAAU,CACtD,CAAC;AAEpC,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,EAAE,QAAQ,WAAW,KAAG,cAkBpE,CAAC"}
|
package/dist/tools/get-schema.js
CHANGED
|
@@ -3,7 +3,14 @@ import * as schemas from "@lemmaoracle/sdk/schemas";
|
|
|
3
3
|
import { runTool } from "../errors.js";
|
|
4
4
|
export const getSchema = (client, input) => schemas.getById(client, input.id);
|
|
5
5
|
export const getSchemaTool = (server, client) => server.registerTool("lemma_get_schema", {
|
|
6
|
-
description: "Retrieve schema
|
|
7
|
-
|
|
6
|
+
description: "Retrieve a Lemma schema by its ID via GET /v1/schemas/{id}. " +
|
|
7
|
+
"A schema declares how documents of a given type are interpreted and normalized. " +
|
|
8
|
+
"Returns SchemaMeta { id, description? } with additionalProperties open — implementations commonly include a `normalize` artifact (WASM that maps raw documents to canonical form) and its content hash. " +
|
|
9
|
+
"Use this when you need to interpret attribute keys returned by lemma_query_verified_attributes.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
id: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("Schema ID. Returned in the `schema` field of VerifiedAttributesQueryResponseItem from lemma_query_verified_attributes, or registered via POST /v1/schemas."),
|
|
14
|
+
},
|
|
8
15
|
}, (input) => runTool(getSchema(client, input)));
|
|
9
16
|
//# sourceMappingURL=get-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-schema.js","sourceRoot":"","sources":["../../src/tools/get-schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAmB,EAAE,KAAqB,EAAuB,EAAE,CAC3F,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAiB,EAAE,MAAmB,EAAkB,EAAE,CACtF,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;IACE,WAAW,
|
|
1
|
+
{"version":3,"file":"get-schema.js","sourceRoot":"","sources":["../../src/tools/get-schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAmB,EAAE,KAAqB,EAAuB,EAAE,CAC3F,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAiB,EAAE,MAAmB,EAAkB,EAAE,CACtF,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;IACE,WAAW,EACT,8DAA8D;QAC9D,kFAAkF;QAClF,0MAA0M;QAC1M,iGAAiG;IACnG,WAAW,EAAE;QACX,EAAE,EAAE,CAAC;aACF,MAAM,EAAE;aACR,QAAQ,CACP,4JAA4J,CAC7J;KACJ;CACF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC7C,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { LemmaClient } from "@lemmaoracle/spec";
|
|
|
4
4
|
export type QueryVerifiedAttributesInput = Readonly<{
|
|
5
5
|
attributes?: ReadonlyArray<Readonly<{
|
|
6
6
|
name: string;
|
|
7
|
-
operator?: "eq" | "neq" | "gt" | "lt";
|
|
7
|
+
operator?: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains";
|
|
8
8
|
value?: unknown;
|
|
9
9
|
}>>;
|
|
10
10
|
schemas?: ReadonlyArray<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-verified-attributes.d.ts","sourceRoot":"","sources":["../../src/tools/query-verified-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAI9E,OAAO,KAAK,EACV,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AA+B3B,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,UAAU,CAAC,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"query-verified-attributes.d.ts","sourceRoot":"","sources":["../../src/tools/query-verified-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAI9E,OAAO,KAAK,EACV,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AA+B3B,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAClD,UAAU,CAAC,EAAE,aAAa,CACxB,QAAQ,CAAC;QACP,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,UAAU,CAAC;QAC1E,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC,CACH,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAcH,eAAO,MAAM,uBAAuB,GAClC,QAAQ,WAAW,EACnB,OAAO,4BAA4B,KAClC,OAAO,CAAC,QAAQ,CAAC;IAClB,OAAO,EAAE,aAAa,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC9C,UAAU,EAAE,OAAO,CAAC;QACpB,KAAK,EAAE,QAAQ,CAAC;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;QACjH,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAQD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,QAAQ,SAAS,EAAE,QAAQ,WAAW,KAAG,cAoDlF,CAAC"}
|
|
@@ -28,17 +28,44 @@ export const queryVerifiedAttributes = async (client, input) => {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
export const queryVerifiedAttributesTool = (server, client) => server.registerTool("lemma_query_verified_attributes", {
|
|
31
|
-
description: "Query cryptographically verified attributes from Lemma
|
|
31
|
+
description: "Query cryptographically verified attributes from Lemma. " +
|
|
32
|
+
"Use this as the primary tool for finding documents whose attributes match given conditions (e.g., \"subject's birthYear lt 2008\"). " +
|
|
33
|
+
"Returns { results: Array<{ docHash, schema, issuerId, subjectId, attributes, isVerified, proof?: { status, circuitId, chainId }, disclosure? }>, hasMore }. " +
|
|
34
|
+
"The MCP layer enriches each item with an `isVerified` flag derived from `proof.status` (true when status is 'verified' or 'onchain-verified'). " +
|
|
35
|
+
"Use lemma_get_proof_status to monitor a specific proof; use lemma_get_schema to interpret the keys returned in `attributes`.",
|
|
32
36
|
inputSchema: {
|
|
33
|
-
attributes: z
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
attributes: z
|
|
38
|
+
.array(z.object({
|
|
39
|
+
name: z.string().describe("Attribute key as defined by the schema."),
|
|
40
|
+
operator: z
|
|
41
|
+
.enum(["eq", "neq", "gt", "gte", "lt", "lte", "in", "contains"])
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Comparison operator. Defaults to eq when omitted. 'in' takes an array value; 'contains' is substring/array-element match."),
|
|
44
|
+
value: z
|
|
45
|
+
.unknown()
|
|
46
|
+
.describe("Comparison target value. Type depends on the schema's attribute definition. For 'in', pass an array."),
|
|
47
|
+
}))
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Attribute predicates to AND-combine."),
|
|
50
|
+
schemas: z
|
|
51
|
+
.array(z.string())
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Restrict results to documents conforming to these schema IDs."),
|
|
54
|
+
chainIds: z
|
|
55
|
+
.array(z.number())
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Restrict results to attributes verified on these chain IDs (EVM)."),
|
|
58
|
+
limit: z
|
|
59
|
+
.number()
|
|
60
|
+
.min(1)
|
|
61
|
+
.max(200)
|
|
62
|
+
.optional()
|
|
63
|
+
.describe("Max results per page (1–200). Defaults to API server default (50)."),
|
|
64
|
+
offset: z
|
|
65
|
+
.number()
|
|
66
|
+
.min(0)
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Pagination offset. Pair with `hasMore` in the response to walk pages."),
|
|
42
69
|
},
|
|
43
70
|
}, (input) => runTool(queryVerifiedAttributes(client, input)));
|
|
44
71
|
//# sourceMappingURL=query-verified-attributes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-verified-attributes.js","sourceRoot":"","sources":["../../src/tools/query-verified-attributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,UAAU,GAAG,CAAC,IASlB,EAUC,EAAE,CACH,CAAC;IACC,GAAG,IAAI;IACP,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;IAC1C,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,UAAU,EAAE,IAAI,CAAC,UAAU;CAC5B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"query-verified-attributes.js","sourceRoot":"","sources":["../../src/tools/query-verified-attributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,UAAU,MAAM,6BAA6B,CAAC;AAK1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,UAAU,GAAG,CAAC,IASlB,EAUC,EAAE,CACH,CAAC;IACC,GAAG,IAAI;IACP,UAAU,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC;IAC1C,KA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GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,oEAAoE,CAAC;QACjF,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,uEAAuE,CAAC;KACrF;CACF,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lemmaoracle/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "MCP server for Lemma Oracle API",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"mcpName": "io.github.lemmaoracle/mcp",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/lemmaoracle/lemma.git",
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
"test": "vitest run"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"@lemmaoracle/sdk": "^0.0.
|
|
38
|
+
"@lemmaoracle/sdk": "^0.0.24",
|
|
38
39
|
"@lemmaoracle/spec": "workspace:*",
|
|
39
40
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
40
41
|
"agents": "^0.11.4",
|