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
- OpenCode installed
- A verified KasLens account. Create one here if you have none. The verification email comes from
[email protected]. Look in your spam folder if it does not arrive
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
- Start OpenCode:
opencode
- Type
/mcps. Both servers show needs authentication - Select
kaslens. A browser window opens with the KasLens login - Sign in with your KasLens email and password and confirm the access
- 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.