@settlemint/sdk-mcp 1.1.16-pr87a2b8ef → 1.1.16-pra97ca1f8

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.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <p align="center">
2
2
  <img src="https://github.com/settlemint/sdk/blob/main/logo.svg" width="200px" align="center" alt="SettleMint logo" />
3
- <h1 align="center">SettleMint SDK</h1>
3
+ <h1 align="center">SettleMint MCP</h1>
4
4
  <p align="center">
5
5
  ✨ <a href="https://settlemint.com">https://settlemint.com</a> ✨
6
6
  <br/>
7
- Integrate SettleMint into your application with ease.
7
+ Integrate SettleMint into your LLM with ease.
8
8
  </p>
9
9
  </p>
10
10
 
@@ -16,7 +16,7 @@
16
16
  </p>
17
17
 
18
18
  <div align="center">
19
- <a href="https://console.settlemint.com/documentation/docs/using-platform/dev-tools/SDK/">Documentation</a>
19
+ <a href="https://console.settlemint.com/documentation">Documentation</a>
20
20
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
21
21
  <a href="https://www.npmjs.com/package/@settlemint/sdk-mcp">NPM</a>
22
22
  <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span>
@@ -24,30 +24,6 @@
24
24
  <br />
25
25
  </div>
26
26
 
27
- ## Table of Contents
28
-
29
- - [About](#about)
30
- - [Usage](#usage)
31
- - [As a dependency in your package.json](#as-a-dependency-in-your-package.json)
32
- - [Globally install the CLI](#globally-install-the-cli)
33
- - [GitHub Action](#github-action)
34
- - [Examples](#examples)
35
- - [Get the version of the CLI](#get-the-version-of-the-cli)
36
- - [Get help for a command](#get-help-for-a-command)
37
- - [Login to the platform](#login-to-the-platform)
38
- - [Creating a new project from a template](#creating-a-new-project-from-a-template)
39
- - [Installing dependencies](#installing-dependencies)
40
- - [Connecting to your SettleMint infrastructure](#connecting-to-your-settlemint-infrastructure)
41
- - [Deploying your smart contracts and subgraphs](#deploying-your-smart-contracts-and-subgraphs)
42
- - [Generating code for your dApp](#generating-code-for-your-dapp)
43
- - [Start your dApp in development mode](#start-your-dapp-in-development-mode)
44
- - [Creating a new project from a smart contract template](#creating-a-new-project-from-a-smart-contract-template)
45
- - [Testing your smart contracts](#testing-your-smart-contracts)
46
- - [Deploying your smart contracts and subgraphs](#deploying-your-smart-contracts-and-subgraphs)
47
- - [API Reference](#api-reference)
48
- - [Contributing](#contributing)
49
- - [License](#license)
50
-
51
27
  ## Introduction to Model Context Protocol (MCP)
52
28
 
53
29
  The Model Context Protocol (MCP) is a framework designed to enhance the capabilities of AI agents and large language models (LLMs) by providing structured, contextual access to external data. It acts as a bridge between AI models and a variety of data sources such as blockchain networks, external APIs, databases, and developer environments. In essence, MCP allows an AI model to pull in relevant context from the outside world, enabling more informed reasoning and interaction.
@@ -110,6 +86,23 @@ This workflow happens quickly and often behind the scenes. From a high-level per
110
86
 
111
87
  MCP consists of a few core components that work together to make the above workflow possible:
112
88
 
89
+ ```mermaid
90
+ flowchart LR
91
+ A[AI Agent / LLM] --(1) request--> B{{MCP Server}}
92
+ subgraph MCP Server
93
+ B --> C1[Blockchain Connector]
94
+ B --> C2[API Connector]
95
+ B --> C3[File System Connector]
96
+ end
97
+ C1 -- fetch/query --> D[(Blockchain Network)]
98
+ C2 -- API call --> E[(External API/Data Source)]
99
+ C3 -- read/write --> F[(Local File System)]
100
+ D -- data --> C1
101
+ E -- data --> C2
102
+ F -- file data --> C3
103
+ B{{MCP Server}} --(2) formatted data--> A[AI Agent / LLM]
104
+ ```
105
+
113
106
  - MCP Server: This is the central service or daemon that runs and listens for requests from AI agents. It can be thought of as the brain of MCP that coordinates everything. The MCP server is configured to know about various data sources and how to connect to them. In practice, you might run an MCP server process locally or on a server, and your AI agent will communicate with it via an API (like HTTP requests, RPC calls, or through an SDK).
114
107
  - MCP SDK / Client Library: To simplify usage, MCP provides SDKs in different programming languages. Developers include these in their AI agent code. The SDK handles the communication details with the MCP server, so a developer can simply call functions or methods (like mcp.getData(...)) without manually constructing network calls. The SDK ensures requests are properly formatted and sends them to the MCP server, then receives the response and hands it to the AI program.
115
108
  - Connectors / Adapters: These are modules or plugins within the MCP server that know how to talk to specific types of external systems. One connector might handle blockchain interactions (with sub-modules for Ethereum, Hyperledger, etc.), another might handle web APIs (performing HTTP calls), another might manage local OS operations (file system access, running shell commands). Each connector understands a set of actions and data formats for its domain. Connectors make MCP extensible - new connectors can be added to support new systems or protocols.
@@ -128,6 +121,32 @@ By leveraging MCP, SettleMint enables scenarios where:
128
121
  - Autonomous agents can manage blockchain infrastructure tasks (deploying contracts, adjusting configurations) without human intervention, guided by AI decision-making.
129
122
  - Developers using SettleMint can integrate advanced AI functionalities into their blockchain applications with relatively little effort, because MCP handles the heavy lifting of connecting the two worlds.
130
123
 
124
+ ```mermaid
125
+ sequenceDiagram
126
+ participant AI as AI Model (Agent)
127
+ participant MCP as MCP Server
128
+ participant Chain as The Graph / Portal / Node
129
+ participant API as External API
130
+
131
+ AI->>MCP: (1) Query request (e.g., get contract state)
132
+ Note over AI,MCP: AI asks MCP for on-chain data
133
+ MCP-->>AI: (2) Acknowledgement & processing
134
+
135
+ MCP->>Chain: (3) Fetch data from blockchain
136
+ Chain-->>MCP: (4) Return contract state
137
+
138
+ MCP->>API: (5) [Optional] Fetch related off-chain data
139
+ API-->>MCP: (6) Return external data
140
+
141
+ MCP-->>AI: (7) Send combined response
142
+ Note over AI,MCP: AI receives on-chain data (and any other context)
143
+
144
+ AI->>MCP: (8) Action request (e.g., execute transaction)
145
+ MCP->>Chain: (9) Submit transaction to blockchain
146
+ Chain-->>MCP: (10) Return tx result/receipt
147
+ MCP-->>AI: (11) Confirm action result
148
+ ```
149
+
131
150
  In summary, SettleMint's version of MCP extends their platform's capabilities, allowing for AI-driven blockchain operations. This combination brings together the trust and transparency of blockchain with the adaptability and intelligence of AI.
132
151
 
133
152
  ### Capabilities and Features
@@ -162,12 +181,12 @@ Suppose you are a developer working on a blockchain project, and you want to use
162
181
  For instance, you might use a command (via a CLI or an npm script) to start an MCP server that is pointed at your project directory and connected to the SettleMint platform. An example command could be:
163
182
 
164
183
  ```sh
165
- bunx @settlemint/sdk-mcp@latest --path=/Users/llm/asset-tokenization-kit/ --pat=sm_pat_xxx
184
+ npx -y @settlemint/sdk-mcp@latest --path=/Users/llm/asset-tokenization-kit/ --pat=sm_pat_xxx
166
185
  ```
167
186
 
168
187
  Here's what this command does:
169
188
 
170
- - bunx is used to execute the latest version of the @settlemint/sdk-mcp package without needing a separate install (similar to how npx works for npm packages).
189
+ - npx is used to execute the latest version of the @settlemint/sdk-mcp package without needing a separate install.
171
190
  - --path=/Users/llm/asset-tokenization-kit/ specifies the local project directory that the MCP server will have context about. This could allow the AI to query files or code in that directory through MCP and have access to the environment settings from `settlemint connect`
172
191
  - --pat=sm_pat_xxx provides a Personal Access Token (PAT) for authenticating with SettleMint's services. This token (masked here as xxx) is required for the MCP server to connect to the SettleMint platform on your behalf.
173
192
 
@@ -180,7 +199,7 @@ After running this command, you would have a local MCP server up and running, co
180
199
 
181
200
  This greatly enhances a development workflow by making the AI an active participant that can fetch and act on real information, rather than just being a passive code suggestion tool.
182
201
 
183
- ### Using the SettleMint MPC in Cursor
202
+ #### Using the SettleMint MPC in Cursor
184
203
 
185
204
  Cursor (0.47.0 and up) provides a global `~/.cursor/mcp.json` file where you can configure the SettleMint MCP server. Point the path to the folder of your program, and set your personal access token.
186
205
 
@@ -190,8 +209,53 @@ Cursor (0.47.0 and up) provides a global `~/.cursor/mcp.json` file where you can
190
209
  {
191
210
  "mcpServers": {
192
211
  "settlemint": {
193
- "command": "bunx",
212
+ "command": "npx",
213
+ "args": [
214
+ "-y",
215
+ "@settlemint/sdk-mcp@latest",
216
+ "--path=/Users/llm/asset-tokenization-kit/",
217
+ "--pat=sm_pat_xxx"
218
+ ]
219
+ }
220
+ }
221
+ }
222
+ ```
223
+
224
+ Open Cursor and navigate to Settings/MCP. You should see a green active status after the server is successfully connected.
225
+
226
+ #### #### Using the SettleMint MPC in Claude Desktop
227
+
228
+ Open Claude desktop and navigate to Settings. Under the Developer tab, tap Edit Config to open the configuration file and add the following configuration:
229
+
230
+ ```json
231
+ {
232
+ "mcpServers": {
233
+ "settlemint": {
234
+ "command": "npx",
235
+ "args": [
236
+ "-y",
237
+ "@settlemint/sdk-mcp@latest",
238
+ "--path=/Users/llm/asset-tokenization-kit/",
239
+ "--pat=sm_pat_xxx"
240
+ ]
241
+ }
242
+ }
243
+ }
244
+ ```
245
+
246
+ Save the configuration file and restart Claude desktop. From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available.
247
+
248
+ #### #### Using the SettleMint MPC in Cline
249
+
250
+ Open the Cline extension in VS Code and tap the MCP Servers icon. Tap Configure MCP Servers to open the configuration file and add the following configuration:
251
+
252
+ ```json
253
+ {
254
+ "mcpServers": {
255
+ "settlemint": {
256
+ "command": "npx",
194
257
  "args": [
258
+ "-y",
195
259
  "@settlemint/sdk-mcp@latest",
196
260
  "--path=/Users/llm/asset-tokenization-kit/",
197
261
  "--pat=sm_pat_xxx"
@@ -201,6 +265,51 @@ Cursor (0.47.0 and up) provides a global `~/.cursor/mcp.json` file where you can
201
265
  }
202
266
  ```
203
267
 
268
+ Save the configuration file. Cline should automatically reload the configuration. You should see a green active status after the server is successfully connected.
269
+
270
+ #### #### Using the SettleMint MPC in Windsurf
271
+
272
+ Open Windsurf and navigate to the Cascade assistant. Tap on the hammer (MCP) icon, then Configure to open the configuration file and add the following configuration:
273
+
274
+
275
+ ```json
276
+ {
277
+ "mcpServers": {
278
+ "settlemint": {
279
+ "command": "npx",
280
+ "args": [
281
+ "-y",
282
+ "@settlemint/sdk-mcp@latest",
283
+ "--path=/Users/llm/asset-tokenization-kit/",
284
+ "--pat=sm_pat_xxx"
285
+ ]
286
+ }
287
+ }
288
+ }
289
+ ```
290
+
291
+ Save the configuration file and reload by tapping Refresh in the Cascade assistant. You should see a green active status after the server is successfully connected.
292
+
293
+ ### AI-Driven Blockchain Application or Agent
294
+
295
+ To illustrate a real-world scenario, consider an AI-driven Decentralized Finance (DeFi) application. In DeFi, conditions change rapidly (prices, liquidity, user activity), and it's critical to respond quickly.
296
+
297
+ Scenario: You have a smart contract that manages an automatic liquidity pool. You want to ensure it remains balanced - if one asset's price drops or the pool becomes unbalanced, you'd like to adjust fees or parameters automatically.
298
+
299
+ Using MCP in this scenario:
300
+
301
+ 1. An AI agent monitors the liquidity pool via MCP. Every few minutes, it requests the latest pool balances and external price data (from on-chain or off-chain oracles) through the MCP server.
302
+ 2. MCP fetches the latest state from the blockchain (pool reserves, recent trades) and maybe calls an external price API for current market prices, then returns that data to the AI.
303
+ 3. The AI analyzes the data. Suppose it finds that Asset A's proportion in the pool has drastically increased relative to Asset B (perhaps because Asset A's price fell sharply).
304
+ 4. The AI decides that to protect the pool, it should increase the swap fee temporarily (a common measure to discourage arbitrage draining the pool).
305
+ 5. Through MCP, the AI calls a function on the smart contract to update the fee parameter. The MCP's blockchain connector handles creating and sending the transaction to the network via SettleMint's infrastructure.
306
+ 6. The transaction is executed on-chain, adjusting the fee. MCP catches the success response and any relevant event (like an event that the contract might emit for a fee change).
307
+ 7. The AI receives confirmation and can log the change or inform administrators that it took action.
308
+
309
+ In this use case, MCP enabled the AI to be a real-time guardian of the DeFi contract. Without MCP, the AI would not have access to the live on-chain state or the ability to execute a change. With MCP, the AI becomes a powerful autonomous agent that ensures the blockchain application adapts to current conditions.
310
+
311
+ This is just one example. AI-driven blockchain applications could range from automatic NFT marketplace management, to AI moderators for DAO proposals, to intelligent supply chain contracts that react to sensor data. MCP provides the pathway for these AI agents to communicate and act where it matters - on the blockchain and connected systems.
312
+
204
313
  ## Contributing
205
314
 
206
315
  We welcome contributions from the community! Please check out our [Contributing](https://github.com/settlemint/sdk/blob/main/.github/CONTRIBUTING.md) guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.
package/dist/mcp.js CHANGED
@@ -55021,7 +55021,7 @@ class Protocol {
55021
55021
  Promise.resolve().then(() => handler(notification)).catch((error) => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
55022
55022
  }
55023
55023
  _onrequest(request) {
55024
- var _a, _b;
55024
+ var _a, _b, _c;
55025
55025
  const handler = (_a = this._requestHandlers.get(request.method)) !== null && _a !== undefined ? _a : this.fallbackRequestHandler;
55026
55026
  if (handler === undefined) {
55027
55027
  (_b = this._transport) === null || _b === undefined || _b.send({
@@ -55036,7 +55036,11 @@ class Protocol {
55036
55036
  }
55037
55037
  const abortController = new AbortController;
55038
55038
  this._requestHandlerAbortControllers.set(request.id, abortController);
55039
- Promise.resolve().then(() => handler(request, { signal: abortController.signal })).then((result) => {
55039
+ const extra = {
55040
+ signal: abortController.signal,
55041
+ sessionId: (_c = this._transport) === null || _c === undefined ? undefined : _c.sessionId
55042
+ };
55043
+ Promise.resolve().then(() => handler(request, extra)).then((result) => {
55040
55044
  var _a2;
55041
55045
  if (abortController.signal.aborted) {
55042
55046
  return;
@@ -62578,7 +62582,7 @@ var {
62578
62582
  var package_default = {
62579
62583
  name: "@settlemint/sdk-mcp",
62580
62584
  description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
62581
- version: "1.1.16-pr87a2b8ef",
62585
+ version: "1.1.16-pra97ca1f8",
62582
62586
  type: "module",
62583
62587
  private: false,
62584
62588
  license: "FSL-1.1-MIT",
@@ -62619,9 +62623,9 @@ var package_default = {
62619
62623
  dependencies: {
62620
62624
  "@graphql-tools/load": "8.0.17",
62621
62625
  "@graphql-tools/url-loader": "8.0.29",
62622
- "@modelcontextprotocol/sdk": "1.6.1",
62623
- "@settlemint/sdk-js": "1.1.16-pr87a2b8ef",
62624
- "@settlemint/sdk-utils": "1.1.16-pr87a2b8ef",
62626
+ "@modelcontextprotocol/sdk": "1.7.0",
62627
+ "@settlemint/sdk-js": "1.1.16-pra97ca1f8",
62628
+ "@settlemint/sdk-utils": "1.1.16-pra97ca1f8",
62625
62629
  "@commander-js/extra-typings": "11.1.0",
62626
62630
  commander: "11.1.0",
62627
62631
  zod: "3.24.2"
@@ -68290,4 +68294,4 @@ await main().catch((error2) => {
68290
68294
  process.exit(1);
68291
68295
  });
68292
68296
 
68293
- //# debugId=0A9F507F237A8C2D64756E2164756E21
68297
+ //# debugId=6EAD499DC66F7D8664756E2164756E21