Skip to main content

Chromia MCP server

The MCP (Model Context Protocol) server enables access to the Chromia blockchain infrastructure and its deployed decentralized applications through the Chromia Explorer's GraphQL API.

The server can be used both by users and AI assistance to query and analyze Chromia blockchain data, including:

  • Network statistics and analytics
  • Blockchain information and metadata
  • Transaction data and analysis
  • Asset information and distribution
  • Account activity and analytics
  • Node performance monitoring
  • Dapp deployment information
  • Documentation retrieval and search

Installation

The installation of the MCP server requires the following prerequisites:

  • Node.js v18 or higher, or
  • Java Development Kit v21 or higher

Install the chromia-mcp-server globally using npm:

npm install @chromia/chromia-mcp-server -g

AI assistants setup

The MCP server runs automatically when you modify the configuration of an AI assistant.

The following JSON configuration applies to all AI assistants presented below:

{
"mcpServers": {
"chromia-mcp": {
"command": "chromia-mcp-server"
}
}
}

In case you need to set up the local development environment with JDK, you have to use the following JSON configuration:

{
"mcpServers": {
"chromia": {
"command": "java",
"args": ["-jar", "path/to/jar/chromia-mcp-server.jar"]
}
}
}

Further, you can find the configuration instructions for the supported AI assistants.

Cursor/Windsurf IDEs

Open the Cursor settings, then navigate to MCP & IntegrationMCP Tools. Add the JSON configuration and save changes.

Claude Desktop

Edit your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Add the JSON configuration and save changes.

Jetbrains AI assitant

  1. Go to Settings → Tools → AI Assistant → MCP.
  2. Click “+” to open the Add dialog.
  3. In the dropdown, switch from "Command" to "As JSON", and paste the JSON configuration.
  4. Set the working directory to the location where this project is cloned.

SSE configuration

The MCP server supports Server-Sent Events (SSE) transport. To use SSE mode, run the application with the --sse argument. Then add the following configuration to your AI assistant:

{
"mcpServers": {
"chromia-mcp-local": {
"url": "http://localhost:3001/sse"
}
}
}

Networks

The MCP server supports the following Chromia networks:

  • Mainnet - Production network.
  • Testnet - Testing network.

Specify the network parameter in your queries to target the appropriate environment.

To retrieve data from the production or testing network, include the string "Mainnet" or "Testnet" in your

prompt. :::

Usage examples

Below you can find the prompt examples and the corresponding responses.

Network statistics

Example 1

Based on the search results, here's the information about My Neighbor Alice blockchains on Chromia mainnet:

My Neighbor Alice Blockchain Information

I found 4 My Neighbor Alice blockchains on mainnet:

Active/Running Blockchains:

  1. Main My Neighbor Alice Blockchain

    • BRID (Blockchain RID): F31D7A38B33D12A5D948EE9CF170983A7CA5EFFFAAA31094C5B9CF94442D9FA2
    • Name: my_neighbor_alice
    • Cluster: pink
    • Container: 611062cdf1047b265b652d229858e5a18dbf487afbb62f0f6d30ec4fd81366f9
    • State: RUNNING ✅
  2. My Neighbor Alice BS2:

    • BRID: 8BC5E4DAA94410BEC640DAEE87CE5C546465C2E7E8D654668BA6267200C97560
    • Name: my_neighbor_alice_bs2
    • Cluster: pink
    • Container: 9f49e091ff1929bc6438a9ee9c5387ec7991eb5eda4154cd7509dd878aa9f70e
    • State: RUNNING ✅

Removed/Legacy Blockchains:

  1. Legacy Instance 1:
    • BRID: 9F0CCB09BBB441E840035086F5326294F51FFA92344D39FFF54B223C7547D81D
    • State: REMOVED
    • Legacy Instance 2
    • BRID: AEBD8E8CD9FCC268D7B5AC3DAC8855F1F9A817B8DD1A98C0F13E60D01DECB90C
    • State: REMOVED

Summary

The currently active My Neighbor Alice deployment is:

  • Primary BRID: F31D7A38B33D12A5D948EE9CF170983A7CA5EFFFAAA31094C5B9CF94442D9FA2
  • Deployed in: pink cluster
  • Container ID: 611062cdf1047b265b652d229858e5a18dbf487afbb62f0f6d30ec4fd81366f9

Both active blockchains are running in the pink cluster, which suggests this is a multi-blockchain deployment for the My Neighbor Alice game ecosystem.

There exist multiple ways to query to Chromia blockchain via the MCP server:

Prompt example
Get network statistics and analytics for the Chromia Mainnet environment.
What is the BRID of my neighbor Alice, and in which cluster and container is it deployed?
Get the latest 10 transactions on Mainnet with the operation type "transfer."
Show activity for account ID: DEF456... across all blockchains.
Which account holds the most CHR assets on Mainnet?
How many active users does my neighbor Alice’s dApp have on Mainnet?
How do I register an account using the FT4 open strategy in Rell? Can you provide TypeScript client code as well?
What is the difference between a query and an operation in Rell?
Could you create a Rell application for managing books that includes FT4 account registration functionality?
How do I use the Chromia CLI to deploy my newly created dApp on Testnet?
What are the steps to deploy a dApp on the Chromia Testnet using the CLI?
How do I configure network settings for a Chromia blockchain?

Advanced blockchain querying

You can interact with specific dApps deployed on Chromia networks by executing their custom queries. Below you can find an example query:

Can you query all the libraries in the Library Chain dApp on Testnet?

Once you send the prompt, the workflow algorithm will act as follows:

  1. The AI searches for blockchains with "Library Chain" on Testnet.
  2. Retrieves the blockchain RID.
  3. Fetches the dApp structure to discover available queries and operations using the Postchain Client.
  4. Executes the get_all_libraries query inside Cursor/Junie.
  5. Returns the results from the Library Chain dApp.

Below you can find other prompt examples for blockchain specific queries:

Prompt example
Get the deployed dApp structure for My Neighbor Alice on Mainnet.
Run the get_user_balance query on the MNA blockchain for account ABC123.
Can you list all the queries available for My Neighbor Alice on Mainnet?

Bidirectional SQL and Rell query translation

When making a request related to Rell and SQL, it's helpful to:

  1. Provide the full SQL or Rell query with proper formatting.
  2. Specify relevant entity structures, especially when referencing an external project.
  3. Mention any special requirements (e.g., sorting, limiting, or null handling).
  4. Include context about the data model if it's not immediately clear.

Below you can find a prompt example that showcases this approach:


I have the following entities in my Rell code:

entity play {
name: text;
genre: text;
duration: integer;
}

entity performance {
play: play;
date: timestamp;
status: text;
}

Can you help me convert this SQL query to Rell?

SELECT p.name, COUNT(pf.id) as performance_count
FROM plays p
LEFT JOIN performances pf ON p.id = pf.play_id
WHERE p.genre = 'DRAMA'
GROUP BY p.name
HAVING COUNT(pf.id) > 5
ORDER BY performance_count DESC;"

This format gives the AI all the context needed for an accurate translation, including:

  • The exact data structure.
  • Relationships between entities.
  • The intended query logic.
  • Any specific output requirements.

Further, you can find multiple query examples that showcase different ways of prompting related to Rell and SQL:

Simple SELECT translation:

"Can you translate this SQL query to Rell?
SELECT name, genre FROM plays WHERE duration_minutes > 120;"

JOIN queries:

How would I write this SQL join in Rell?
SELECT p.name, t.name, b.timestamp
FROM bookings b
JOIN performances p ON b.performance_id = p.id
JOIN theater_halls t ON p.theater_id = t.id
WHERE b.status = 'CONFIRMED';"

Aggregation queries:

Convert this SQL aggregation to Rell syntax:
SELECT play_name, COUNT(*) as total_bookings, SUM(price) as revenue
FROM bookings b
JOIN performances p ON b.performance_id = p.id
GROUP BY play_name
HAVING COUNT(*) > 5;"

Subqueries:

How do I write this SQL subquery in Rell?
SELECT name FROM plays
WHERE id IN (
SELECT play_id FROM performances
WHERE timestamp > NOW()
);"

Complex conditions:

Translate this SQL query with multiple conditions to Rell:
SELECT DISTINCT p.name, t.name
FROM plays p
JOIN performances pf ON p.id = pf.play_id
JOIN theater_halls t ON pf.theater_id = t.id
WHERE p.genre = 'DRAMA'
AND pf.timestamp BETWEEN ? AND ?
AND EXISTS (
SELECT 1 FROM bookings b
WHERE b.performance_id = pf.id
);"

From Rell to SQL

Can you translate this Rell query to SQL?
(b: bookings, p: performances) @* {
b.performance_id == p.id
} (
@group play_name = p.play_name,
total_bookings = @sum 1,
revenue = @sum b.price
) @* {
.total_bookings > 5
}