Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENCODE_PORTNoPort for the opencode server0
OPENCODE_LOG_LEVELNoLog level: DEBUG, INFO, WARNING, ERRORINFO
OPENCODE_DEFAULT_MODELNoDefault model for new opencode sessionsollama/qwen3.5:cloud
OPENCODE_REQUEST_TIMEOUTNoSeconds before a generation times out120
OPENCODE_SERVER_PASSWORDNoOptional HTTP Basic Auth password for the opencode server
OPENCODE_STARTUP_TIMEOUTNoSeconds to wait for opencode to start10

Capabilities

Features and capabilities supported by this server

CapabilityDetails
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

NameDescription
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:

  • Specify EXACT file paths (absolute). Never say 'the config file' — say the full path.

  • Break multi-step work into numbered steps within the same message.

  • Specify the output format: 'return a code block', 'return JSON', 'list changed files'.

  • If the task involves multiple files, list all of them explicitly.

  • If you want opencode to run a command, say exactly which command and in which directory.

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:

  • Default work → gemini-3-flash-preview (fast, capable, most tasks)

  • Complex work → gemini-3.1-pro-preview (deep reasoning, architecture, hard bugs)

  • Bulk/batch work → gemini-2.5-flash-lite (fastest, cheapest, high-volume tasks)

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:

  • Default work → leave model empty (CLI picks best for your tier)

  • Complex work → qwen-max (deep reasoning, architecture, hard bugs)

  • Standard work → qwen-plus (balanced, most coding tasks)

  • Bulk/batch work → qwen-turbo (fastest, cheapest, high-volume tasks)

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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

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