@openctx/provider-modelcontextprotocol
TypeScript icon, indicating that this package has built-in type declarations

0.0.14 • Public • Published

MCP proxy for OpenCtx

This is a context provider for OpenCtx that fetches contents from a MCP provider for use as context.

Currently, only MCP over stdio is supported (HTTP is not yet supported).

Development

  1. Clone the modelcontextprotocol/servers repository. Follow the instructions there to build the example providers. This should generate output files of the form build/${example_name}/index.js.
  2. Run pnpm watch in this directory.
  3. Add the following to your VS Code settings:
    "openctx.providers": {
        // ...other providers...
        "https://openctx.org/npm/@openctx/provider-modelcontextprotocol": {
            "nodeCommand": "node",
            "mcp.provider.uri": "file:///path/to/servers/root/build/everything/index.js",
        }
    }
  4. Reload the VS Code window. You should see servers/everything in the @-mention dropdown.

To hook up to the Postgres MCP provider, use:

"openctx.providers": {
    // ...other providers...
    "https://openctx.org/npm/@openctx/provider-modelcontextprotocol": {
        "nodeCommand": "node",
        "mcp.provider.uri": "file:///path/to/servers/root/build/postgres/index.js",
        "mcp.provider.args": [
            "postgresql://sourcegraph:sourcegraph@localhost:5432/sourcegraph"
        ]
    }
}

More MCP Servers

The following MCP servers are available in the modelcontextprotocol/servers repository:

  • Brave Search - Search the Brave search API
  • Postgres - Connect to your Postgres databases to query schema information and write optimized SQL
  • Filesystem - Access files on your local machine
  • Everything - A demo server showing MCP capabilities
  • Google Drive - Search and access your Google Drive documents
  • Google Maps - Get directions and information about places
  • Memo - Access your Memo notes
  • Git - Get git history and commit information
  • Puppeteer - Control headless Chrome for web automation
  • SQLite - Query SQLite databases

Creating your own MCP server

See the MCP docs for how to create your own MCP servers.

Readme

Keywords

none

Package Sidebar

Install

npm i @openctx/provider-modelcontextprotocol

Weekly Downloads

124

Version

0.0.14

License

Apache-2.0

Unpacked Size

182 kB

Total Files

5

Last publish

Collaborators

  • sqs
  • sourcegraph-bot
  • mualam
  • keegan-src