Closed
Description
add mcp
to @llamaindex/tool
package:
for using stdio mcp:
const server = mcp({
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem"],
env: ...
});
for using sse mcp:
const server = mcp({
url: "http://localhost:3000/sse",
env: ...
});
for using the tools provided by the mcp servers:
const myAgent = agent({
name: "Assistant",
systemPrompt: `Use the tools to achieve the task.`,
tools: server.tools(),
});
first start with stdio