Skip to content

UNABLE_TO_GET_ISSUER_CERT_LOCALLY #1666

Closed as not planned
Closed as not planned
@riponbanik

Description

@riponbanik

Describe the bug
Can't work with local proxy certificate. Node environment variable set for internal CA.
export NODE_EXTRA_CA_CERTS="xxx"

To Reproduce
Steps to reproduce the behavior:
Use the block below to create Slack MCP Server
slack_command = "npx -y @modelcontextprotocol/server-slack"
slack_server = MCPServerStdio(
name="Slack MCP Server",
params={
"command": slack_command.split(" ")[0],
"args": slack_command.split(" ")[1:],
"env": {
"SLACK_BOT_TOKEN": os.environ["SLACK_BOT_TOKEN"],
"SLACK_TEAM_ID": os.environ["SLACK_TEAM_ID"],
},
},

Expected behavior
A clear and concise description of what you expected to happen.
Need to have local ca support like below if cant honour systemwide ca cert.

"SLACK_MCP_SERVER_CA": os.environ["NODE_EXTRA_CA_CERTS],
"SLACK_MCP_SERVER_CA_INSECURE": "true"

Logs
Error executing tool: TypeError: fetch failed
at node:internal/deps/undici/undici:13502:13
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SlackClient.getChannelHistory (file:///home/user/.npm/_npx/71b7d53511ff2b57/node_modules/@modelcontextprotocol/server-slack/dist/index.js:236:26)
at async file:///home/user/.npm/_npx/71b7d53511ff2b57/node_modules/@modelcontextprotocol/server-slack/dist/index.js:338:38 {
[cause]: Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1679:34)
at TLSSocket.emit (node:events:518:28)
at TLSSocket._finishInit (node:_tls_wrap:1078:8)
at ssl.onhandshakedone (node:_tls_wrap:864:12) {
code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'
}
}

Additional context
Calling MCP server with OpenAI agent:

async with fs_server as fs, slack_server as slack:

        agent = Agent(
            name="OpenAI Agent w/ MCP Servers",
            instructions="Use the tools to access the filesystem and slack workspaces.",
            mcp_servers=[fs, slack],

        )
        prompt = input("Enter a prompt (MCP servers (fs, slack) are available): ")
        result = await Runner.run(starting_agent=agent, input=prompt)
        print(result.final_output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions