npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@clickonsearch/openai-remote-mcp-bridge

v0.2.2

Published

Bridge that lets an OpenAI agent (Chat Completions tool-calling) discover and call tools exposed by one or more remote MCP servers.

Downloads

803

Readme

openai-remote-mcp-bridge

Lets OpenAI call tools from any remote MCP server. Most people use this through github-agent rather than directly — this README is for using the bridge on its own.

Setup

Create an mcp.config.json in the folder you'll run this from:

{
  "servers": [
    {
      "name": "Github",
      "url": "https://api.githubcopilot.com/mcp/",
      "transport": "http",
      "headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
    }
  ]
}
  • transport is "http" or "sse".
  • Header values can reference env vars with ${ENV_VAR} (e.g. GITHUB_TOKEN above).
  • Point MCP_CONFIG_PATH at a different file if you don't want it named mcp.config.json.

Run

OPENAI_API_KEY=<your-key> GITHUB_TOKEN=<your-token> \
  npx @clickonsearch/openai-remote-mcp-bridge "your prompt here"

For developers

Running from source:

cd bridges/openai-remote-mcp-bridge
npm install
cp .env.example .env            # fill in OPENAI_API_KEY
cd ../..
cp mcp.config.example.json mcp.config.json
# edit it to point at your MCP server(s), and fill in any tokens it references
cd bridges/openai-remote-mcp-bridge
npm run dev -- "your prompt here"

How it works: McpManager connects to each configured MCP server and lists its tools, exposing each one to OpenAI as a function tool (namespaced <serverName>__<toolName> to avoid collisions). runAgent then runs the standard OpenAI tool-calling loop — send messages + tools, dispatch any tool_calls to the matching MCP server, feed the result back — until the model returns a final answer.

OpenAI model --tool_calls--> McpManager --MCP protocol--> remote MCP server
     ^                                                           |
     └────────────────────── tool result ───────────────────────┘

Using it as a library:

import OpenAI from "openai";
import { McpManager } from "./src/mcpManager.js";
import { runAgent } from "./src/agent.js";
import { loadMcpConfig } from "./src/config.js";

const mcp = new McpManager();
await mcp.connectAll((await loadMcpConfig("./mcp.config.json")).servers);

const answer = await runAgent({
  openai: new OpenAI({ apiKey: process.env.OPENAI_API_KEY! }),
  model: "gpt-4.1",
  userPrompt: "...",
  mcp,
});

await mcp.closeAll();

Conversation history: pass earlier turns as history (oldest first, plain text, sent before userPrompt) to give the model context from an ongoing conversation:

const answer = await runAgent({
  // ...client, model, mcp as above
  history: [
    { role: "user", content: "Call me Ash" },
    { role: "assistant", content: "Sure, Ash!" },
  ],
  userPrompt: "What's my name?",
});

Tool calls/results from earlier turns aren't replayed — keep history bounded (e.g. the last 20 messages) to control cost.