vastavikadi/somnia-mcp
If you are the rightful owner of somnia-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Somnia MCP server is a versatile tool for interacting with blockchain data, offering a modular architecture for easy extension and customization.
Somnia MCP Server
This is the Somnia MCP server implementation. It provides various tools and resources for interacting with blockchain data.
Features
- Get information about blockchain blocks
- Retrieve token balances and transaction history
- Access NFT metadata and ownership details
- Fetch transaction details
- Modular architecture for easy extension and customization
What can be Built on Top of Somnia MCP Server?
The Somnia MCP server provides a robust foundation for building various applications and services, including:
- Decentralized finance (DeFi) applications
- Non-fungible token (NFT) marketplaces
- Blockchain explorers
- Wallets and portfolio trackers
- Custom analytics and reporting tools
- Even AI assistants that can interact with blockchain data ( AI AGENTS )
Getting Started
To get started with the Somnia MCP server, follow these steps:
-
Clone the repository:
git clone https://github.com/vastavikadi/somnia-mcp.git cd somnia-mcp -
Install dependencies:
npm install -
Configure environment variables: Create a
.envfile in the root directory and add your configuration:AUTH_TOKEN=your_auth_tokenNOTE: Replace
your_auth_tokenwith your actual AUTH_TOKEN(That is going to be the ORMI API KEY) from https://subgraph.somnia.network/ by creating an account. -
Build the server:
npm run server:build -
After that make to add the mcp server to your MCP Client. In this case, my IDE (VSCode) is MCP Client. So I have to add the server in the mcp.json file present in the .vscode folder.
{ "servers": { "somniamcp": { "type": "stdio", "command": "node", "args": ["build/server.js"], "dev": { "watch": "src//*.ts", "debug": { "type": "node" } }, "cwd": "${workspaceFolder}", "env": { "authToken": "${env:authToken}" } } }, "inputs": [] } -
You are now ready to start the Somnia MCP server!. Start from the mcp.json file.
-
Restart the server from mcp.json file to get the fresh tools.
-
Enjoy using the Somnia MCP server!. If you want to use in Copilot then simply use
#and then the name of the tool you want to use. For example,#getBlockHeightsto use the Get Block Heights tool.
NOTE: You can also run the command
npm run server:dev
to start the server in development mode with hot-reloading.
or
npm run server:inspect
to start the server in the inspect mode.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.