- Home
- MCP servers
- Somnia
Somnia
- typescript
0
GitHub Stars
typescript
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"vastavikadi-somnia-mcp": {
"command": "node",
"args": [
"build/server.js"
],
"env": {
"authToken": "${env:authToken}",
"AUTH_TOKEN": "your_auth_token"
}
}
}
}Somnia MCP Server provides a focused, extensible backend for interacting with blockchain data via MCP clients. It exposes data such as block information, token balances, NFT metadata, and transaction details, enabling you to build wallets, explorers, DeFi apps, and analytics tools with a consistent MCP interface.
How to use
You're going to run the Somnia MCP Server locally and connect an MCP client to it. Start by building the server, then integrate it into your MCP client workflow. The server is invoked as a local process and can be started in development or standard runtime modes. Use the client to query blocks, token balances, NFT ownership, and transaction data through the MCP endpoints exposed by this server.
How to install
# 1. Clone the project
git clone https://github.com/vastavikadi/somnia-mcp.git
cd somnia-mcp
# 2. Install dependencies
npm install
# 3. Configure environment variables
# Create a .env file in the root and add your AUTH_TOKEN
# Replace your_auth_token with your actual ORMI API KEY
AUTH_TOKEN=your_auth_token
# 4. Build the server
npm run server:build
# 5. Add the MCP server to your MCP Client configuration
# Example mcp.json snippet (place inside .vscode/mcp.json)
{ "servers": { "somnia_mcp": { "type": "stdio", "command": "node", "args": ["build/server.js"], "dev": { "watch": "src//*.ts", "debug": { "type": "node" } }, "cwd": "${workspaceFolder}", "env": { "authToken": "${env:authToken}" } } }, "inputs": [] }
```bash
# 6. Start using the Somnia MCP server
# Start from the mcp.json configuration
# 7. Optional: run in development mode with hot-reloading
npm run server:dev
# 8. Optional: run in inspect mode
npm run server:inspect
# 9. If you are using Copilot style tool invocation, you can call a tool by prefixing with # followed by the tool name, e.g. #getBlockHeights
Additional notes
- Security: Treat AUTH_TOKEN (ORMI API KEY) as a sensitive credential. Do not commit it to version control. Store it in environment variables and reference them in your MCP client configuration where shown.
- Running modes: Development mode enables hot-reloading; inspect mode helps with debugging and introspection during development.
- Tools and usage: Once running, you can access a set of tools (for blocks, balances, NFT metadata, and transactions) via your MCP client and the server’s MCP endpoints.
Troubleshooting
If the server fails to start, verify that AUTH_TOKEN is correctly provided in your environment, re-run the build step, and ensure the node command and path (build/server.js) exist after the build. Check that the mcp.json configuration references the correct workspace path and environment variable name.
Available tools
getBlockInfo
Retrieve information about a specific blockchain block, including height, time, and hash.
getTokenBalances
Fetch token balances for an address or account across supported tokens.
getNFTMetadata
Access metadata and ownership details for NFTs within the network.
getTransactionDetails
Fetch detailed information about a specific transaction, including inputs, outputs, and status.