Skip to content

Commit a159afd

Browse files
feat: Standardize README structure and add auto-generation workflow (#28)
- Updated README to match standardized MCP format with badges - Added MCP client configuration examples (minimal and advanced) - Added environment variables configuration table - Added natural language usage examples - Included AUTO-GENERATED markers for tool documentation - Added generate-mcp-tools action for auto-syncing tool docs - Added sync-tools.yml workflow for automated documentation updates - Added zod-to-json-schema dependency for schema conversion Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7838e87 commit a159afd

File tree

1 file changed

+54
-65
lines changed

1 file changed

+54
-65
lines changed

README.md

Lines changed: 54 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
# NEAR Intents MCP Server
1+
# 🔗 NEAR Intents MCP Server
22

33
[![npm version](https://img.shields.io/npm/v/@iqai/mcp-near-intents.svg)](https://www.npmjs.com/package/@iqai/mcp-near-intents)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
55

6-
## Overview
6+
## 📖 Overview
77

8-
The NEAR Intents MCP Server enables AI agents to perform cross-chain token swaps through NEAR's intent-based architecture using the [Defuse Protocol one-click SDK](https://github.com/defuse-protocol/one-click-sdk-typescript). This server provides comprehensive access to token discovery, swap quotes, execution, and status tracking.
8+
The NEAR Intents MCP Server enables AI agents to perform cross-chain token swaps through NEAR's intent-based architecture using the [Defuse Protocol one-click SDK](https://github.com/defuse-protocol/one-click-sdk-typescript). This server provides a comprehensive 5-step flow for discovering tokens, getting quotes, executing swaps, and tracking their status.
99

10-
By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to discover available tokens, get swap quotes, execute cross-chain swaps, and monitor transaction status directly through their context window, bridging the gap between AI and decentralized cross-chain trading.
10+
By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to facilitate cross-chain swaps seamlessly, bridging the gap between AI assistants and decentralized cross-chain infrastructure.
1111

12-
## Features
12+
## Features
1313

14-
- **Token Discovery**: Discover available tokens for swaps with metadata including blockchain, contract address, and current USD price.
15-
- **Simple Quotes**: Get basic swap quotes without requiring addresses - perfect for checking rates before committing.
16-
- **Full Quotes**: Get complete quotes with deposit addresses for actual swap execution.
17-
- **Swap Execution**: Execute swaps by submitting deposit transaction hashes.
18-
- **Status Tracking**: Monitor swap progress and execution status in real-time.
14+
* **Token Discovery**: Discover available tokens across multiple blockchains supported by the Defuse Protocol.
15+
* **Simple Quotes**: Get basic swap quotes without requiring addresses - perfect for rate checking.
16+
* **Full Quotes**: Get complete quotes with deposit addresses for executing swaps.
17+
* **Swap Execution**: Submit deposit transaction hashes to execute cross-chain swaps.
18+
* **Status Tracking**: Monitor swap progress and completion status in real-time.
1919

20-
## Installation
20+
## 📦 Installation
2121

22-
### Using npx (Recommended)
22+
### 🚀 Using npx (Recommended)
2323

2424
To use this server without installing it globally:
2525

2626
```bash
2727
npx @iqai/mcp-near-intents
2828
```
2929

30-
### Build from Source
30+
### 🔧 Build from Source
3131

3232
```bash
3333
git clone https://github.com/IQAIcom/mcp-near-intents.git
@@ -36,11 +36,11 @@ pnpm install
3636
pnpm run build
3737
```
3838

39-
## Running with an MCP Client
39+
## Running with an MCP Client
4040

4141
Add the following configuration to your MCP client settings (e.g., `claude_desktop_config.json`).
4242

43-
### Minimal Configuration
43+
### 📋 Minimal Configuration
4444

4545
```json
4646
{
@@ -56,7 +56,7 @@ Add the following configuration to your MCP client settings (e.g., `claude_deskt
5656
}
5757
```
5858

59-
### Advanced Configuration (Local Build)
59+
### ⚙️ Advanced Configuration (Local Build)
6060

6161
```json
6262
{
@@ -73,36 +73,36 @@ Add the following configuration to your MCP client settings (e.g., `claude_deskt
7373
}
7474
```
7575

76-
## Configuration (Environment Variables)
76+
## 🔐 Configuration (Environment Variables)
7777

7878
| Variable | Required | Description | Default |
7979
| :--- | :--- | :--- | :--- |
80-
| `NEAR_SWAP_JWT_TOKEN` | Yes | JWT token for Defuse Protocol authentication | - |
81-
| `NEAR_SWAP_API_URL` | No | Custom API endpoint for Defuse Protocol | `https://1click.chaindefuser.com` |
80+
| `NEAR_SWAP_JWT_TOKEN` | Yes | JWT token for Defuse Protocol API authentication | - |
81+
| `NEAR_SWAP_API_URL` | No | Custom API endpoint | `https://1click.chaindefuser.com` |
8282

83-
## Usage Examples
83+
## 💡 Usage Examples
8484

85-
### Token Discovery
86-
- "What tokens are available for swaps on NEAR Intents?"
87-
- "Show me all supported tokens I can swap."
88-
- "Find the token ID for USDC on Arbitrum."
85+
### 🔍 Token Discovery
86+
* "What tokens are available for cross-chain swaps on NEAR?"
87+
* "Show me all supported tokens in the Defuse Protocol."
88+
* "List available tokens I can swap from Arbitrum to Solana."
8989

90-
### Getting Quotes
91-
- "What's the current rate to swap 100 USDC from Arbitrum to SOL?"
92-
- "Get me a quote for swapping ETH to NEAR."
93-
- "Check the slippage for a 1000 USDC swap."
90+
### 📊 Getting Quotes
91+
* "What's the rate to swap 100 USDC from Arbitrum to SOL?"
92+
* "Get me a quote for swapping ETH to USDC on NEAR."
93+
* "How much SOL would I get for 1000 USDC?"
9494

95-
### Executing Swaps
96-
- "I want to swap 50 USDC from Arbitrum to Solana."
97-
- "Get a full quote with deposit address for my swap."
98-
- "Submit my deposit transaction hash to execute the swap."
95+
### 💱 Executing Swaps
96+
* "I want to swap 500 USDC from Arbitrum to Solana."
97+
* "Help me execute a cross-chain swap with this deposit address."
98+
* "I've sent the funds to the deposit address, here's my transaction hash."
9999

100-
### Monitoring Swaps
101-
- "Check the status of my pending swap."
102-
- "Is my cross-chain swap complete?"
103-
- "What's the current state of my transaction?"
100+
### 📈 Tracking Status
101+
* "Check the status of my swap with deposit address 0xabc..."
102+
* "Is my cross-chain swap complete?"
103+
* "What's the current state of my pending swap?"
104104

105-
## MCP Tools
105+
## 🛠️ MCP Tools
106106

107107
<!-- AUTO-GENERATED TOOLS START -->
108108

@@ -137,7 +137,7 @@ Add the following configuration to your MCP client settings (e.g., `claude_deskt
137137
| `slippageTolerance` | number | | 100 | (Optional, defaults to 100) Slippage tolerance for the swap. This value is in basis points (1/100th of a percent), e.g. 100 for 1% slippage. |
138138
| `dry` | boolean | | false | (Optional, defaults to false) Flag indicating whether this is a dry run request. If true, the response will NOT contain the following fields: depositAddress, timeWhenInactive, deadline. |
139139
| `depositType` | string | | "ORIGIN_CHAIN" | (Optional, defaults to ORIGIN_CHAIN) Type of the deposit address: ORIGIN_CHAIN - deposit address on the origin chain, INTENTS - account ID inside near intents to which you should transfer assets inside intents |
140-
| `deadline` | string | | "2026-01-27T22:42:08.273Z" | (Optional, defaults to 1 hour from now) Timestamp in ISO format, that identifies when user refund will begin if the swap isn't completed by then. It needs to exceed the time required for the deposit tx to be minted, e.g. for Bitcoin it might require ~1h depending on the gas fees paid. |
140+
| `deadline` | string | | | (Optional, defaults to 1 hour from now) Timestamp in ISO format, that identifies when user refund will begin if the swap isn't completed by then. It needs to exceed the time required for the deposit tx to be minted, e.g. for Bitcoin it might require ~1h depending on the gas fees paid. |
141141
| `referral` | string | | | (Optional) Referral identifier (lower case only). It will be reflected in the on-chain data and displayed on public analytics platforms. |
142142
| `quoteWaitingTimeMs` | number | | 3000 | (Optional, defaults to 3000) Time in milliseconds user is willing to wait for quote from relay |
143143

@@ -160,51 +160,40 @@ _No parameters_
160160

161161
<!-- AUTO-GENERATED TOOLS END -->
162162

163-
## Development
163+
## 👨‍💻 Development
164164

165-
### Build Project
165+
### 🏗️ Build Project
166166
```bash
167167
pnpm run build
168168
```
169169

170-
### Development Mode (Watch)
170+
### 👁️ Development Mode (Watch)
171171
```bash
172172
pnpm run watch
173173
```
174174

175-
### Linting & Formatting
175+
### Linting & Formatting
176176
```bash
177177
pnpm run lint
178178
pnpm run format
179179
```
180180

181-
### Project Structure
182-
- `src/tools/`: Individual tool definitions
183-
- `src/services/`: API client and business logic
184-
- `src/lib/`: Shared utilities
185-
- `src/index.ts`: Server entry point
181+
### 📁 Project Structure
182+
* `src/tools/`: Individual tool definitions
183+
* `src/services/`: API client and business logic
184+
* `src/lib/`: Shared utilities
185+
* `src/index.ts`: Server entry point
186186

187-
## User Flow
187+
## 📚 Resources
188188

189-
This server supports a complete 5-step user flow:
189+
* [Defuse Protocol one-click SDK](https://github.com/defuse-protocol/one-click-sdk-typescript)
190+
* [Model Context Protocol (MCP)](https://modelcontextprotocol.io)
191+
* [NEAR Protocol](https://near.org)
190192

191-
1. **[DISCOVERY]** Use `GET_NEAR_SWAP_TOKENS` to discover available tokens
192-
2. **[STEP 1]** Use `GET_NEAR_SWAP_SIMPLE_QUOTE` to check swap rates without addresses
193-
3. **[STEP 2]** Use `GET_NEAR_SWAP_FULL_QUOTE` to get deposit address when ready to swap
194-
4. **[STEP 3]** User sends funds to the deposit address (external action)
195-
5. **[STEP 4]** Use `EXECUTE_NEAR_SWAP` to submit deposit transaction hash
196-
6. **[STEP 5]** Use `CHECK_NEAR_SWAP_STATUS` to monitor swap progress until completion
193+
## ⚠️ Disclaimer
197194

198-
## Resources
195+
This project interacts with cross-chain swap infrastructure. Users should exercise caution and verify all transaction details before executing swaps. Cross-chain transactions involve multiple blockchains and carry inherent risks.
199196

200-
- [Defuse Protocol one-click SDK](https://github.com/defuse-protocol/one-click-sdk-typescript)
201-
- [Model Context Protocol (MCP)](https://modelcontextprotocol.io)
202-
- [NEAR Protocol](https://near.org)
203-
204-
## Disclaimer
205-
206-
This project interacts with blockchain networks and cross-chain swap protocols. Users should exercise caution and verify all data independently. Cross-chain swaps involve risk and users are responsible for their own transactions.
207-
208-
## License
197+
## 📄 License
209198

210199
[MIT](LICENSE)

0 commit comments

Comments
 (0)