polycode
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCODE_PORT | No | Port for the opencode server | 0 |
| OPENCODE_LOG_LEVEL | No | Log level: DEBUG, INFO, WARNING, ERROR | INFO |
| OPENCODE_DEFAULT_MODEL | No | Default model for new opencode sessions | ollama/qwen3.5:cloud |
| OPENCODE_REQUEST_TIMEOUT | No | Seconds before a generation times out | 120 |
| OPENCODE_SERVER_PASSWORD | No | Optional HTTP Basic Auth password for the opencode server | |
| OPENCODE_STARTUP_TIMEOUT | No | Seconds to wait for opencode to start | 10 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| opencode_start_sessionA | Start a new opencode session. Call this before opencode_send_message. Returns session_id, model, and project_dir. Store session_id — every subsequent call to opencode_send_message requires it. Use opencode for coding tasks: writing, editing, refactoring, debugging, explaining code. For tasks requiring reasoning or research, prefer gemini_prompt or qwen_prompt instead. |
| opencode_send_messageB | Send a detailed instruction to an active opencode session and return the response. PROMPTING RULES:
|
| opencode_get_historyA | Return the full message history for an opencode session (tracked in-process). Each message has: role (user/assistant), content, timestamp. Use this to review what has been sent and received before sending the next message. |
| opencode_list_sessionsA | List all currently active opencode sessions with session_id, model, project_dir, message count, and creation time. Use this to find a session_id if you have lost track of it. |
| opencode_end_sessionA | Close an opencode session and free its resources. Call this when a task is complete. Do not leave sessions open indefinitely. |
| opencode_list_modelsA | List all models available in opencode across all connected providers, grouped by provider. Only providers you are authenticated with will return models. Returns: models (flat list), by_provider (grouped dict), total count, default_model. Use this before opencode_start_session to pick the right model for the task. |
| opencode_set_modelA | Change the default model used for all new opencode sessions. Takes effect immediately for all subsequent opencode_start_session calls. Does not affect already-open sessions. |
| gemini_check_authA | Check whether the Gemini CLI is authenticated before making any gemini_prompt calls. Always call this first if you are unsure whether Gemini is set up. Returns: authenticated (bool), method, detail, suggestion. If authenticated is false, read the suggestion field — it contains the exact fix. |
| gemini_promptA | Send a detailed prompt to the Gemini CLI. Returns response text, model used, and session_id. MODEL SELECTION:
SESSION CONTINUITY: First call returns a session_id. Pass it back on the next call to continue the conversation. Gemini persists session history to disk — context is preserved across calls. ALWAYS write detailed prompts. Include file paths, numbered steps, and output format. |
| gemini_list_sessionsA | List saved Gemini CLI sessions for the current project. Returns a list of sessions with their index and first-message preview. Use this to find a session_id to resume a previous conversation. |
| qwen_check_authA | Check whether the Qwen Code CLI is authenticated before making any qwen_prompt calls. Always call this first if you are unsure whether Qwen is set up. Returns: authenticated (bool), method (qwen-oauth / coding-plan / api-key), detail, suggestion. If authenticated is false, read the suggestion field — it contains the exact command to run. |
| qwen_promptA | Send a detailed prompt to the Qwen Code CLI. Returns response text, model used, and session_id. MODEL SELECTION:
SESSION CONTINUITY: First call returns a session_id. Pass it back on the next call to continue the conversation. Qwen persists session history to disk — context is preserved across calls. ALWAYS write detailed prompts. Include file paths, numbered steps, and output format. |
| opencode_shutdownA | Gracefully stop the opencode server and close all active sessions. Call this when you are done with all opencode work in the current session. Gemini and Qwen CLI tools are not affected — they are stateless subprocesses. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/h19overflow/polycode'
If you have feedback or need assistance with the MCP directory API, please join our Discord server