Skip to content

Add adapter to use MCP servers as tools #1817

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcusschiesser opened this issue Apr 3, 2025 · 2 comments
Closed

Add adapter to use MCP servers as tools #1817

marcusschiesser opened this issue Apr 3, 2025 · 2 comments
Assignees

Comments

@marcusschiesser
Copy link
Collaborator

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

@leehuwuj
Copy link
Collaborator

leehuwuj commented Apr 4, 2025

#1819 having some trouble with SSE:

  1. @modelcontextprotocol/sdk fails in CommonJS projects due to incompatible ESM-only dependency (pkce-challenge) modelcontextprotocol/typescript-sdk#217
  2. Even with a manual fix for 1., the client is still not connect to the sever through sse (no network issue):
Error: Not connected
    at SSEClientTransport.send (./node_modules/.pnpm/@[email protected]/node_modules/@modelcontextprotocol/sdk/src/client/sse.ts:210:13)

@marcusschiesser marcusschiesser moved this from In Progress to Todo in Framework Apr 15, 2025
@marcusschiesser marcusschiesser moved this from Todo to In Progress in Framework Apr 20, 2025
@marcusschiesser marcusschiesser moved this from In Progress to Done in Framework Apr 23, 2025
@marcusschiesser marcusschiesser closed this as completed by moving to Done in Framework Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants