Skip to main content
Glama
README.md
# 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:

1. Clone the repository:

   ```bash
   git clone https://github.com/vastavikadi/somnia-mcp.git
   cd somnia-mcp
   ```

2. Install dependencies:

   ```bash
   npm install
   ```

3. Configure environment variables:
   Create a `.env` file in the root directory and add your configuration:

   ```env
   AUTH_TOKEN=your_auth_token
   ```

   NOTE: Replace `your_auth_token` with your actual AUTH_TOKEN(That is going to be the ORMI API KEY) from https://subgraph.somnia.network/ by creating an account.

4. Build the server:
   ```bash
   npm run server:build
   ```
5. 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.

   ```json
   {
     "servers": {
       "somniamcp": {
         "type": "stdio",
         "command": "node",
         "args": ["build/server.js"],
         "dev": {
           "watch": "src//*.ts",
           "debug": {
             "type": "node"
           }
         },
         "cwd": "${workspaceFolder}",
         "env": {
           "authToken": "${env:authToken}"
         }
       }
     },
     "inputs": []
   }
   ```

6. You are now ready to start the Somnia MCP server!. Start from the mcp.json file.
7. Restart the server from mcp.json file to get the fresh tools.

8. 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, `#getBlockHeights` to use the Get Block Heights tool.

NOTE: You can also run the command

```bash
npm run server:dev
```
to start the server in development mode with hot-reloading.

or 
```bash
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.

## Don't forget to give a star to the repository if you find it useful! ⭐

TDQS

C2.7/5.0

Scored across 26 tools

Disambiguation2/5

Many tools have overlapping functionality, e.g., getERC20Balance, getTokenBalance, getHistoricalBalance, and getTokenBalancePortfolio all relate to balances. Similarly, getRecentTransactions, getLatestTransactions, getTransactionsForAddress, and getBulkTransactions all fetch transactions, making it difficult for an agent to select the correct tool.

Naming Consistency4/5

All tools consistently follow the 'get' + CamelCase noun phrase pattern (e.g., getERC20Balance, getBlockHeights, getTokenHolders). Minor variations like getNFTtokensByAddress with mixed casing are slight deviations, but the overall naming convention is uniform and predictable.

Tool Count2/5

With 26 tools, the server is over the recommended range and feels bloated. Many tools could be consolidated (e.g., balance queries could be unified into fewer endpoints), and the redundancy makes the tool set heavier than necessary for its domain.

Completeness4/5

The blockchain data retrieval domain is well covered, including blocks, transactions, balances, transfers, logs, and token holders. Minor gaps such as a direct native balance endpoint or token metadata search can be worked around, but core operations are present.

Maintenance

ActivityInactive
ResponsivenessNo issues