MCP server for klever-connect — Unified JavaScript/TypeScript SDK for the Klever blockchain. Provides offline transaction building, wallet management (Node + Browser extension), provider/network communication, smart contract interactions (ABI-based), HD wallets, and React hooks.
| Knowledge File | Entries | Content |
|---|---|---|
| api-reference.json | 46 | API methods, classes, and interfaces |
| best-practices.json | 11 | Recommended patterns and security tips |
| configuration.json | 5 | Network, provider, and environment setup |
| documentation.json | 9 | Architecture guides and migration docs |
| errors.json | 12 | Common error patterns with fixes |
| examples.json | 21 | Working code snippets (Node.js, React, contracts) |
| patterns.json | 12 | Design patterns and integration workflows |
| types.json | 9 | TypeScript types and interfaces |
| Total | 125 |
MODE=mcp npx -y @klever/klever-connect-mcp # stdio mode (Claude Desktop / Cursor / Claude Code)
npx -y @klever/klever-connect-mcp # HTTP mode -> http://localhost:3000/mcp
MODE=public npx -y @klever/klever-connect-mcp # public HTTP mode with security headerspnpm install
pnpm dev # HTTP mode -> http://localhost:3000/mcp
MODE=mcp pnpm dev:mcp # stdio mode for Claude Desktop / Cursor- Node.js >= 18.14.0
- pnpm (recommended) or npm
git clone https://github.com/klever-io/mcp-klever-connect.git
cd mcp-klever-connect
pnpm install
pnpm buildpnpm dev # development (auto-reload)
pnpm start # production (requires pnpm build first)MCP endpoint: http://localhost:3000/mcp
MODE=mcp pnpm dev:mcpMODE=public CORS_ORIGINS=https://yourdomain.com pnpm dev:public| Variable | Default | Description |
|---|---|---|
MODE |
http |
http, public, mcp/stdio |
PORT |
3000 |
Server port |
HOST |
0.0.0.0 |
Bind address |
KNOWLEDGE_DIR |
./knowledge |
Path to knowledge JSONs |
MAX_SIZE |
10000 |
Max entries in memory |
CORS_ORIGINS |
* |
Comma-separated allowed origins |
| Tool | Description |
|---|---|
query_context |
Structured search with BM25 ranking + type/tag/category filters |
get_context |
Retrieve full entry by ID |
find_similar |
Find related entries by tag/type overlap |
get_knowledge_stats |
Knowledge base overview (total, types, top tags) |
enhance_with_context |
Augment a query with top-5 relevant entries |
search_documentation |
Natural-language search with formatted markdown output |
| URI | Description |
|---|---|
knowledge://index |
Browse all categories, types, and top tags |
knowledge://category/{category} |
All entries in a category |
knowledge://type/{type} |
All entries of a type |
knowledge://entry/{id} |
Single entry with full content |
| Type | Description |
|---|---|
code_example |
Working code snippets |
best_practice |
Recommended patterns |
security_tip |
Security guidance |
optimization |
Performance advice |
documentation |
API reference and guides |
error_pattern |
Common mistakes + fixes |
deployment_tool |
Build/deploy instructions |
runtime_behavior |
Lifecycle and gotchas |
The knowledge base uses BM25 full-text ranking with:
- Stopword filtering — removes noise words (the, is, how, what, show, code, example, etc.)
- Stemming — matches plural/tense variations (balance/balances/balanced)
- Weighted fields — titles and tags are weighted higher than content body
- Relevance scoring — combines BM25 scores with curated relevance metadata
mcp-klever-connect/
├── src/
│ ├── types/index.ts Zod schemas + TypeScript types
│ ├── storage/memory.ts In-memory storage with BM25 search
│ ├── storage/index.ts Storage exports
│ ├── context/service.ts Business logic + relevance scoring
│ ├── utils/auto-ingest.ts Knowledge JSON loader
│ ├── mcp/server.ts MCP server (tools + resources + prompt hook)
│ ├── mcp/resources.ts Resource builders (markdown output)
│ └── index.ts Entry point (http/public/stdio modes)
├── knowledge/ Knowledge base JSON files (125 entries)
├── package.json
├── tsconfig.json
├── Makefile
└── Dockerfile
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"klever-connect": {
"command": "npx",
"args": ["-y", "@klever/klever-connect-mcp"],
"env": { "MODE": "mcp" }
}
}
}Alternatively, point at a local build:
{
"mcpServers": {
"klever-connect": {
"command": "node",
"args": ["/absolute/path/to/mcp-klever-connect/dist/index.js"],
"env": { "MODE": "mcp" }
}
}
}Edit .cursor/mcp.json in your workspace:
{
"mcpServers": {
"klever-connect": {
"command": "npx",
"args": ["-y", "@klever/klever-connect-mcp"],
"env": { "MODE": "mcp" }
}
}
}claude mcp add klever-connect --env MODE=mcp -- npx -y @klever/klever-connect-mcpclaude mcp add klever-connect --transport http http://localhost:3000/mcpdocker build -t klever-connect-mcp .
docker run -p 3000:3000 -e MODE=public klever-connect-mcp # HTTP public
docker run klever-connect-mcp # stdio (default)MIT