I’m having some trouble setting up the MCP server with the SDK agent, and it seems like something’s not quite right. Can you help me?
import { Agent, MCPServerStreamableHttp } from "@openai/agents";
export const jiramcp = new MCPServerStreamableHttp({
name: "Atlassian MCP",
url: "https://mcp.atlassian.com/v1/mcp",
requestInit: {
headers: {
Authorization: `Bearer ${process.env.ATLASSIAN_ACCESS_TOKEN}`,
},
},
});
export const jiraAgent = new Agent({
name: "Jira Agent",
instructions:
"You provide assistance with Jira-related queries. Explain workflows and features clearly.",
mcpServers: [jiramcp],
});
export const mainAgent = Agent.create({
model: "gpt-5.2",
name: "Main Agent",
instructions:
"You determine which agent to use based on the user's homework question",
handoffs: [jiraAgent],
});
import { mainAgent, jiramcp, jiraAgent } from "./core";
import { run } from "@openai/agents";
import "./config/config";
async function main() {
try {
await jiramcp.connect();
const result = await run(jiraAgent, "List all Jira projects");
console.log(result.finalOutput);
} finally {
await jiramcp.close();
}
}
main().catch((error) => {
console.error("Error running the agent:", error);
});
Error
Error running the agent: 2013 | ListTasksResultSchema,
2014 | CreateTaskResultSchema
2015 | ]);
2016 | export class McpError extends Error {
2017 | constructor(code, message, data) {
2018 | super(MCP error ${code}: ${message});
^
McpError: MCP error -32601: Method not found
code: -32601,
data: undefined,