Skip to content

Supporting MCP Servers in runTools function #1533

@rabisg

Description

@rabisg

Confirm this is a feature request for the Node library and not the underlying OpenAI API.

  • This is a feature request for the Node library

Describe the feature or improvement you're requesting

runTools has been a great addition to the node library, greatly improving DX. This proposal is about extending the runTools functionality to support MCP servers directly instead of having to call mcp.listTools and mcp.callTool separately within your own code. Something like:

tools: [
  {
    "type": "function",
    "function": {
      "name": "internal_tool",
      {...}
    }
  },
  {
    "type": "mcp_server",
    "server": {
      "host": "127.0.0.1",
      "port": 8000,
      {...}
    }
  },
  {
    "type": "mcp_server",
    "server": {
      "host": "mcp.external-service.com",
      {...}
    }
  }
]

Would that be something the OpenAI team would consider adding. The code for it would be simple enough - I can even send a PR if we agree on the direction and the interface for it.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions