Add the SDK, or expose as a MCP server · Issue #865 · anomalyco/opencode · GitHub
Skip to content

Add the SDK, or expose as a MCP server #865

Closed

Description

@liaokaime

I want to create a code question-answering tool. I need to ask some questions from the code repository and then open code will explain it to me. Based on this, I will create an API to expose it externally. I have noticed that currently Open Code only runs on the command line and does not provide SDK or MCP services to developers (although other MCP services can be used, it cannot provide services externally). I believe that more than just me requires this feature, because the code interpretation service is a very useful function, especially in the future when we need to jointly search for answers or bugs from multiple code repositories (for example, adding Open Code's MCP service for front-end and back-end code repositories to the Claude client).

Activity

  1. barshag commented on Jul 11, 2025

    @barshag

    Support- like claude code sdk!

  2. self-assigned this
    on Jul 12, 2025
  3. thdxr commented on Aug 27, 2025

    @thdxr
    Member
  4. ashish16052 commented on Jul 9, 2026

    @ashish16052

    This is a useful distinction:

    • MCP/API/SDK gives you a way to call OpenCode.
    • A runtime layer gives you a safe way to host OpenCode as part of another product.

    For “ask questions about a repo and expose it externally,” I would avoid one global OpenCode process shared by all users/repos. I’d run isolated runtime state per repo/user, keep config/permissions scoped to that runtime, stream responses back to the external API, and have a cleanup path for stale or stuck sessions.

    That runtime concern is separate from whether the control surface is MCP, HTTP, or SDK. The control surface is the interface; the runtime is the thing that owns process lifecycle, workspace isolation, health checks, and session reuse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions