Skip to main content
Glama
uchiha-vivek

opencode-hello-mcp

by uchiha-vivek

opencode-mcp-lab

Learning MCP (Model Context Protocol) by building my own servers and using them with opencode + DeepSeek.

Servers

Server

What it does

opencode-hello-mcp

One tool, greet-tool: the "hello world" of MCP

Related MCP server: Hello World MCP Server

Setup

npm install

Test a server without AI (free)

npm run inspect

Use it in opencode

opencode

Then ask: greet Vivek using the greet tool

Connecting & disconnecting MCP servers

MCP servers are wired up in opencode.json (project root). opencode reads it on startup, so restart opencode after any change (/exit, then opencode).

Connect a server

Add an entry under "mcp" with "enabled": true:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "opencode-hello-mcp": {
      "type": "local",
      "command": ["node", "servers/hello-mcp/index.ts"],
      "enabled": true
    }
  }
}
  • "opencode-hello-mcp": the name opencode shows (tools appear as opencode-hello-mcp_greet-tool)

  • "type": "local": opencode starts the server on your machine

  • "command": how to start it (run from the project root)

Check it's connected

opencode mcp list

Or inside opencode: the status bar shows 1 MCP, and /status shows whether each server is connected.

Disconnect: 3 ways

1. Turn it off temporarily (recommended): set "enabled": false in opencode.json and restart opencode:

"opencode-hello-mcp": {
  "type": "local",
  "command": ["node", "servers/hello-mcp/index.ts"],
  "enabled": false
}

Set it back to true to reconnect.

2. Toggle it for this session only: inside opencode, type /mcps and switch servers on or off. No file changes; resets next time you start opencode.

3. Remove it completely: delete the whole "opencode-hello-mcp": { ... } block from opencode.json and restart opencode.

Disconnecting never deletes your server code. servers/hello-mcp/index.ts stays, so you can reconnect anytime.

Why disconnect?

Every connected server's tool descriptions are sent to the AI with every message, which costs tokens. Keep only the servers you're using switched on.

Related MCP Connectors

Related MCP Servers

  • -
    license
    C
    quality
    Not graded
    maintenance
    A simple boilerplate MCP server that provides a basic greeting tool for demonstration purposes. Serves as a starting template for developers to quickly create and deploy custom MCP servers.
    1
    6 npm
    -
  • A
    license
    C
    quality
    D
    maintenance
    A simple MCP server that provides a basic greeting tool for saying hello with customizable names. Serves as a boilerplate template for developers to quickly create and deploy new MCP servers.
    1
    6 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal learning-focused MCP server that demonstrates core primitives like tools and resources through simple greeting functions. It provides a foundational example for connecting AI models to external data using both Streamable HTTP and stdio transports.
    13 npm
    MIT