Remote OpenCode MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Remote OpenCode MCP ServerCreate a new session and ask OpenCode to write a binary search algorithm."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Remote OpenCode MCP Server
A Model Context Protocol (MCP) server that enables remote access to OpenCode AI coding agent. This allows MCP-compatible clients (Claude Desktop, Cursor, etc.) to leverage OpenCode's capabilities.
Features
Remote OpenCode Integration: Connect to OpenCode instances running anywhere
MCP Protocol: Full MCP server implementation with SSE transport
4 Core Tools:
Create new sessions
Send prompts with automatic timeout handling
Check session status and history
List all sessions
Configurable Timeout: Adjustable task timeout via environment variable
Authentication Support: Optional password protection
Related MCP server: Shellagent MCP Server
Requirements
Python 3.12+
OpenCode running in serve mode
OpenCode Serve Mode
This MCP server requires OpenCode to be running in serve mode with API enabled:
opencode --serveOr with custom port and password:
opencode --serve --port 4096 --password your_passwordMake sure OPENCODE_URL and OPENCODE_SERVER_PASSWORD in your .env match the serve command.
Installation
From Source
git clone https://github.com/Dirichelet/remote-opencode-mcp.git
cd remote-opencode-mcp
uv syncUsing uv
uv add remote-opencode-mcpConfiguration
Create a .env file (copy from example.env):
cp example.env .envEnvironment Variables
Variable | Description | Default |
| OpenCode server URL |
|
| Authentication password | (none) |
| MCP server port |
|
| Task wait timeout in seconds (0 for async) |
|
Usage
Start the Server
python server.pyOr with uv:
uv run python server.pyOutput:
=========================================
🚀 OpenCode MCP Server started
🎯 Target: http://127.0.0.1:4096
⏱️ Task timeout: 60 seconds
🔗 SSE URL: http://127.0.0.1:14962/sse
=========================================Available Tools
1. opencode_create_session
Create a new OpenCode session.
Input:
{
"title": "My Task" // optional
}2. opencode_send_prompt
Send a prompt to an existing session and wait for result.
Input:
{
"session_id": "ses_xxxx",
"prompt": "Help me write a Python function"
}3. opencode_check_session
Get session status and full conversation history.
Input:
{
"session_id": "ses_xxxx"
}4. opencode_list_sessions
List all sessions.
Input:
{
"limit": 10 // optional, default 10
}MCP Client Integration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"opencode": {
"command": "uv",
"args": ["--directory", "/path/to/remote-opencode-mcp", "run", "python", "server.py"]
}
}
}Other MCP Clients
Connect to the SSE endpoint:
http://localhost:14962/sseWorkflow Example
User → MCP Client → remote-opencode-mcp → OpenCode Server
↓
1. Create session
2. Send prompt
3. Wait for result
4. Return to clientDevelopment
Install Dev Dependencies
uv sync --extra devLinting
uv run ruff check .Type Checking
uv run mypy .License
MIT License - see LICENSE for details.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Related
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dirichelet/remote-opencode-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server