Help Center / MCP Server / OpenCode

Connect KasLens to OpenCode

Access Kaspa data from your terminal AI agent.

Connect KasLens to OpenCode

OpenCode is a coding agent that runs in your terminal. This guide connects both KasLens MCP servers to it.

What you need


Step 1: Add the servers

Run these commands in your project folder:

opencode mcp add kaslens --url https://kaspa-lens.com/mcp
opencode mcp add kaslens-analytics --url https://analytics.kaspa-lens.com/mcp

Add --global to have the servers in every project.

Or write them into your config file, opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "kaslens": {
        "type": "remote",
        "url": "https://kaspa-lens.com/mcp"
      },
      "kaslens-analytics": {
        "type": "remote",
        "url": "https://analytics.kaspa-lens.com/mcp"
      }
    }
  }
}

Current OpenCode versions expect the servers under mcp.servers.


Step 2: Sign in

  1. Start OpenCode:
opencode
  1. Type /mcps. Both servers show needs authentication
  2. Select kaslens. A browser window opens with the KasLens login
  3. Sign in with your KasLens email and password and confirm the access
  4. Do the same for kaslens-analytics

If no browser opens, run this in your terminal:

opencode mcp auth kaslens

Step 3: Ask

  • What is the Kaspa price right now, and on which exchange is the volume highest?
  • Summarize today's Daily Pulse.
  • How much of the Kaspa supply has not moved for more than a year?
  • Compare the Kaspa price with the realized price.

Sign out

OpenCode keeps the login on your machine and renews it by itself. To remove it:

opencode mcp logout kaslens

Troubleshooting

A server is not reachable

Test it from your terminal:

curl -s -o /dev/null -w "%{http_code}" -X POST https://kaspa-lens.com/mcp

The answer 401 is right: the server is there and asks for a login.

"Email not verified"

Click the link in the verification email from [email protected] first. Look in your spam folder.

More help

See the OpenCode MCP documentation.