
OpenCode MCP Server: Setup for Claude, Cursor and Other Apps
Lets Claude, Cursor and other assistants hand coding tasks to OpenCode, track background jobs and review the changes.
This is a community server by Alaeddine Messadi that connects your assistant to OpenCode, the open source coding agent. Your assistant can send a task, watch it run in the background, answer its questions and permission requests, and review the file changes. It is not made by the OpenCode project.
It runs on your computer and needs an OpenCode server already running, started with the command in the install notes. It needs Node.js 22 or newer. OpenCode can edit files and run commands, so the assistant gets that reach too.
Good for
- Developers who run OpenCode and want another assistant to delegate to it
- Claude or Cursor users who want long coding jobs to run in the background
- Teams who work across several projects or git worktrees
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install opencode MCP
Claude Code
- 1
Copy this prompt.
Add the opencode MCP server to Claude Code. Run this command: claude mcp add opencode -- npx -y opencode-mcp Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js, OpenCode server running (opencode serve --port 4096), Node.js 22+.
Start OpenCode first from your project folder with opencode serve --hostname 127.0.0.1 --port 4096. Then restart your app and call the setup tool to choose a provider and model. Set OPENCODE_BASE_URL if the server is somewhere else.
Built from the package data we hold. Not yet tested by us.
Tools
Checks OpenCode and your provider setup
Reports whether OpenCode is reachable, which model providers are configured and what is still missing. Run it first.
Try: “Check that OpenCode is ready to use.”
Read ·
opencode_setupAsks OpenCode a question in one step
Starts a new session, sends your prompt and returns the answer. The OpenCode agent can act on the project, not just talk.
Try: “Ask OpenCode how the auth flow works in this repo.”
Runs code ·
opencode_askSends a task and waits for the result
Runs a coding task through OpenCode, waits for it and returns a job ID. If the wait times out the task keeps running.
Try: “Have OpenCode add input validation to POST /api/users.”
Runs code ·
opencode_runStarts a background coding task
Sends a task and returns job, session and message IDs at once, so you can check later.
Try: “Start OpenCode on the refactor and report back later.”
Runs code ·
opencode_fireChecks progress of a task
Shows current status, pending input, todos and file counts for a session or job.
Try: “How is the OpenCode task going?”
Read ·
opencode_checkWaits for a task to finish
Waits until a session or job completes, fails, needs input or reaches a time limit. Cancelling the wait does not stop OpenCode.
Try: “Wait for the OpenCode task to finish.”
Read ·
opencode_waitSends a follow-up to a session
Continues an existing session with another message.
Try: “Tell OpenCode to also update the tests.”
Runs code ·
opencode_replySummarizes file changes from a session
Returns a readable summary of every file change a session made, with diffs.
Try: “Show what OpenCode changed.”
Read ·
opencode_review_changesShows a session's full conversation
Returns all messages of a session with their roles and content.
Try: “Show the conversation from the last session.”
Read ·
opencode_conversationShows project context
Returns the current project, path, version control info, config and available agents in one call.
Try: “What project is OpenCode working in?”
Read ·
opencode_contextShows a quick status dashboard
Reports server health, provider count, session count and version control info.
Try: “Give me OpenCode's status.”
Read ·
opencode_statusOverviews all sessions
Lists sessions with titles and status to find one to continue.
Try: “Which sessions are open?”
Read ·
opencode_sessions_overviewTests that a provider works
Creates a temporary session, sends a trivial prompt, checks the answer and cleans up. It may use provider credits.
Try: “Test whether my Anthropic provider works.”
Write ·
opencode_provider_testLists retained jobs
Shows jobs this server remembers in your credential scope.
Try: “List my OpenCode jobs.”
Read ·
opencode_job_listLooks at a job
Shows a job's state, pending inputs and final result.
Try: “Show job abc.”
Read ·
opencode_job_getCancels a job
Aborts the OpenCode session that owns the job, which also stops other work in that session.
Try: “Cancel job abc.”
Write ·
opencode_job_cancelAnswers a job's pending questions
Responds to questions or permission requests of a job. It never approves automatically.
Try: “Answer the pending question on job abc with option A.”
Write ·
opencode_job_inputLists pending questions
Shows questions OpenCode is waiting on, optionally for one session.
Try: “Does OpenCode have questions for me?”
Read ·
opencode_question_listAnswers a question
Replies to a question with chosen labels or free text.
Try: “Pick the second option for that question.”
Write ·
opencode_question_replyDeclines a question
Rejects a pending question explicitly.
Try: “Reject that question.”
Write ·
opencode_question_rejectLists pending permission requests
Shows sessions blocked waiting for approval, for example to run a shell command.
Try: “Is any session waiting for permission?”
Read ·
opencode_permission_listAnswers a permission request
Approves once, approves always for matching requests, or rejects. Always lets OpenCode do the same thing again without asking.
Try: “Approve that request once.”
Write ·
opencode_session_permissionLists sessions
Returns all sessions.
Try: “List all OpenCode sessions.”
Read ·
opencode_session_listReads one session
Returns details of a session by ID.
Try: “Show session abc.”
Read ·
opencode_session_getLists child sessions
Returns sessions created under a session.
Try: “Show child sessions of abc.”
Read ·
opencode_session_childrenShows status of all sessions
Returns running or idle state for every session.
Try: “Which sessions are running?”
Read ·
opencode_session_statusShows a session's todo list
Returns the todo items of a session.
Try: “Show the todos of session abc.”
Read ·
opencode_session_todoShows a session's diff
Returns the diff for a session or one message.
Try: “Show the diff for session abc.”
Read ·
opencode_session_diffSearches sessions by title
Finds sessions whose title contains a keyword.
Try: “Find the session about the login bug.”
Read ·
opencode_session_searchCreates a session
Starts a new, empty session, optionally under a parent and with a title.
Try: “Create a session called Refactor.”
Write ·
opencode_session_createForks a session
Copies a session, optionally from a chosen message.
Try: “Fork session abc at message 3.”
Write ·
opencode_session_forkRenames a session
Updates properties such as the title.
Try: “Rename session abc to Auth work.”
Write ·
opencode_session_updateStops a running session
Aborts a session that is running.
Try: “Stop session abc.”
Write ·
opencode_session_abortDeletes a session
Removes a session and all its data.
Try: “Delete session abc.”
Delete ·
opencode_session_deleteCreates AGENTS.md for a project
Analyzes the app and writes an AGENTS.md. It can take a minute or more.
Try: “Initialize AGENTS.md for this project.”
Write ·
opencode_session_initSummarizes a session
Summarizes a session with a model you choose. It can take a minute or more.
Try: “Summarize session abc.”
Write ·
opencode_session_summarizeReverts a message
Undoes a message's changes in a session.
Try: “Revert the last message in session abc.”
Write ·
opencode_session_revertRestores reverted messages
Brings back all messages that were reverted in a session.
Try: “Undo the revert in session abc.”
Write ·
opencode_session_unrevertShares a session publicly
Makes a session available at a public link.
Try: “Share session abc.”
Write ·
opencode_session_shareStops sharing a session
Removes the public link of a session.
Try: “Unshare session abc.”
Write ·
opencode_session_unshareRuns a slash command in a session
Executes a command such as /init, /undo or /redo.
Try: “Run /undo in session abc.”
Runs code ·
opencode_command_executeLists messages in a session
Returns the messages of a session with roles and content.
Try: “List the messages in session abc.”
Read ·
opencode_message_listReads one message
Returns the details of a message in a session.
Try: “Show message 3 of session abc.”
Read ·
opencode_message_getSends a message and waits for the answer
Posts a prompt to a session and returns the reply. OpenCode can act on the project.
Try: “Send this prompt to session abc.”
Runs code ·
opencode_message_sendSends a message without waiting
Posts a prompt and returns a message ID to observe later.
Try: “Send this prompt and let it run.”
Runs code ·
opencode_message_send_asyncRuns a shell command through OpenCode
Executes a shell command in a session, on the machine where OpenCode runs.
Try: “Run npm test through OpenCode.”
Runs code ·
opencode_shell_executeLists files at a path
Lists files and folders on the OpenCode server's project.
Try: “List the src folder.”
Files ·
opencode_file_listReads a file
Returns the content of a file on the OpenCode server.
Try: “Read src/index.ts.”
Files ·
opencode_file_readShows version control file status
Lists modified, added and deleted files.
Try: “Which files changed?”
Read ·
opencode_file_statusFinds files by name
Fuzzy-matches file and folder names.
Try: “Find files named config.”
Read ·
opencode_find_fileFinds code symbols
Searches workspace symbols such as functions and classes.
Try: “Find the function parseConfig.”
Read ·
opencode_find_symbolSearches text in files
Searches project files for a pattern, regex allowed, and returns paths, lines and matches.
Try: “Search for TODO in the project.”
Read ·
opencode_find_textReads OpenCode's configuration
Returns the current OpenCode configuration.
Try: “Show my OpenCode config.”
Read ·
opencode_config_getLists providers and default models
Returns configured providers and their default models.
Try: “Which providers are configured?”
Read ·
opencode_config_providersChanges OpenCode's configuration
Updates the configuration with the fields you pass.
Try: “Set the default model to claude-sonnet.”
Write ·
opencode_config_updateStores a provider credential
Saves an API key for a provider globally, shared across projects.
Try: “Save this API key for the OpenAI provider.”
Write ·
opencode_auth_setLists sign-in methods for providers
Shows how each provider can be authenticated.
Try: “How can I sign in to each provider?”
Read ·
opencode_provider_auth_methodsLists providers and connection status
Returns a compact summary of providers and whether they are connected.
Try: “Which providers are connected?”
Read ·
opencode_provider_listLists models of a provider
Returns the models available from one provider.
Try: “Which models does Anthropic offer here?”
Read ·
opencode_provider_modelsStarts provider OAuth sign-in
Begins the OAuth flow for a provider.
Try: “Start signing in to the provider.”
Write ·
opencode_provider_oauth_authorizeCompletes provider OAuth sign-in
Handles the OAuth callback for a provider.
Try: “Finish the provider sign-in.”
Write ·
opencode_provider_oauth_callbackAdds text to the terminal prompt
Appends text to OpenCode's terminal UI prompt box.
Try: “Add this text to the TUI prompt.”
Write ·
opencode_tui_append_promptClears the terminal prompt
Empties the TUI prompt box.
Try: “Clear the TUI prompt.”
Write ·
opencode_tui_clear_promptSubmits the terminal prompt
Presses Enter on the TUI prompt, which sends it to the agent.
Try: “Submit the TUI prompt.”
Runs code ·
opencode_tui_submit_promptRuns a command in the terminal UI
Executes a slash command through the TUI.
Try: “Run /init in the TUI.”
Runs code ·
opencode_tui_execute_commandOpens the TUI help
Shows the help dialog in the terminal UI.
Try: “Open help in the TUI.”
Write ·
opencode_tui_open_helpOpens the TUI model picker
Shows the model selector in the terminal UI.
Try: “Open the model picker.”
Write ·
opencode_tui_open_modelsOpens the TUI session picker
Shows the session selector in the terminal UI.
Try: “Open the session picker.”
Write ·
opencode_tui_open_sessionsOpens the TUI theme picker
Shows the theme selector in the terminal UI.
Try: “Open the theme picker.”
Write ·
opencode_tui_open_themesShows a TUI notification
Displays a toast message in the terminal UI.
Try: “Show a toast saying done.”
Write ·
opencode_tui_show_toastShows the active project
Returns the project OpenCode is using now.
Try: “Which project is active?”
Read ·
opencode_project_currentLists known projects
Returns projects the OpenCode server knows.
Try: “List OpenCode projects.”
Read ·
opencode_project_listCreates or opens a project folder
Makes or opens a folder on the machine running this MCP server to host a separate OpenCode session.
Try: “Create a new project in /work/demo.”
Write ·
opencode_project_initCollects recent OpenCode events
Listens for project events for a set time and returns what it saw.
Try: “Watch OpenCode events for 10 seconds.”
Read ·
opencode_events_pollChecks server health
Returns whether the OpenCode server is healthy and its version.
Try: “Is OpenCode up?”
Read ·
opencode_healthLists available agents
Returns agents with names, descriptions and modes.
Try: “Which OpenCode agents exist?”
Read ·
opencode_agent_listLists slash commands
Returns built-in and custom commands.
Try: “Which commands can I run?”
Read ·
opencode_command_listShows formatter status
Returns the state of configured formatters.
Try: “Which formatters are active?”
Read ·
opencode_formatter_statusShows language server status
Returns the state of language servers.
Try: “Are language servers running?”
Read ·
opencode_lsp_statusShows OpenCode's own MCP servers
Returns the status of MCP servers configured inside OpenCode.
Try: “Which MCP servers does OpenCode use?”
Read ·
opencode_mcp_statusAdds an MCP server to OpenCode
Registers another MCP server in OpenCode at run time, which gives OpenCode more tools.
Try: “Add this MCP server to OpenCode.”
Write ·
opencode_mcp_addShows the server's working path
Returns the working directory of the OpenCode server.
Try: “What folder is OpenCode running in?”
Read ·
opencode_path_getLists tool IDs OpenCode can use
Returns tool identifiers available to the model (experimental).
Try: “List OpenCode's tool IDs.”
Read ·
opencode_tool_idsLists tools with schemas
Returns tools and input schemas for a provider and model (experimental).
Try: “Show tools available for this model.”
Read ·
opencode_tool_listShows version control info
Returns branch, remote and status of the project.
Try: “Which branch is OpenCode on?”
Read ·
opencode_vcs_infoWrites a log entry
Adds an entry to the OpenCode server log.
Try: “Log that the migration started.”
Write ·
opencode_logShuts down the OpenCode instance
Disposes the current OpenCode instance, which terminates the server.
Try: “Shut down OpenCode.”
Delete ·
opencode_instance_dispose
Read from the source code
Permissions
high risk · 5 things to watch
High risk
Through OpenCode the assistant can edit your files, run shell commands, change OpenCode's settings and credentials, and delete sessions, and there is no read-only mode. Approve permission requests one at a time and avoid the always-allow reply.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can run shell commands and edit your code
The shell tool and the task tools make OpenCode act on the project and the machine it runs on. Keep OpenCode's own permission prompts on and review the diff afterwards. github.com
One tool shuts the OpenCode server down
The dispose tool terminates the running OpenCode instance, and the session delete tool removes a session and its data. github.com
It can change OpenCode's settings and credentials
Tools update the config, save provider API keys and add other MCP servers to OpenCode. Only allow these when you asked for them. github.com
The always-approve reply is permanent for matching requests
Replying always to a permission request approves the same kind of request again later. Prefer approving once. github.com
The smaller tool profile still includes risky tools
Setting OPENCODE_TOOL_PROFILE to essential gives 25 tools, but it keeps the run, fire, reply, ask and session abort tools, so OpenCode can still change code. github.com
Security advisories
No published security advisories as of Nov 1, 2026.
Technical details
| Talks to | The OpenCode server at OPENCODE_BASE_URL (http://127.0.0.1:4096 by default). Whatever model providers OpenCode uses |
|---|---|
| Sign-in and keys | No sign-in by default. Optional server username and password, or a bearer token, can be set in environment variables. Job records are kept in a local state folder. |
Questions
Is the OpenCode MCP server official, and is it the OpenCode client?
No. It is a community server by Alaeddine Messadi that lets your assistant drive an OpenCode server, and the OpenCode team (sst/opencode) did not make it. It is not the OpenCode client itself: you install and run OpenCode separately.
What do I need running first?
An OpenCode server on your computer, started from your project folder with the command in the install notes. You also need Node.js 22 or newer, and OpenCode 1.x.
Does it need an API key?
Not for this server. OpenCode itself needs a configured model provider, and you can pick it with the setup tool. A server username, password or bearer token is optional.
Can I use fewer tools?
Yes. Set OPENCODE_TOOL_PROFILE to essential for a 25-tool set. It still lets the assistant start coding work, so it is not read-only.
Can it run tasks in the background?
Yes. The fire tool starts a task and returns IDs, and the check and wait tools follow it later. A timeout while waiting does not mean the task failed.
Can two tasks run in the same project?
They can, but the README warns that independent sessions do not isolate file changes. Use separate folders or git worktrees for overlapping tasks.
How do I add it to Claude Code?
Use the Claude Code tab in the install box above, and start the OpenCode server first.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
opencode-mcp- Registry
- npm
- Transport
- stdio
- Auth
- None
- Version
- 3.1.0
- License
- MIT
- Last commit
- Oct 29, 2026
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 3Hide
- github.com · github.com
- github.com · github.com
- www.npmjs.com · npmjs.com