Skip to content

feat!(js/plugins/mcp): renamed mcp plugin package to @genkit-ai/mcp and new MCP client API #3123

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

pavelgj
Copy link
Collaborator

@pavelgj pavelgj commented Jun 23, 2025

import { createMcpClient } from '@genkit-ai/mcp';

const myFsClient = createMcpClient({
  name: 'myFileSystemClient', // A unique name for this client instance
  command: 'npx',
  args: ['-y', '@modelcontextprotocol/server-everything', '/Users/yourusername/Documents'],
});

async function runSimpleClient() {
  const response = await ai.generate({
    model: googleAI.model('gemini-2.0-flash'), // Replace with your model
    prompt: 'List files in my Documents folder.',
    tools: await myFsClient.getActiveTools(ai),
  });
  console.log(response.text);
}

Checklist (if applicable):

@github-actions github-actions bot added docs Improvements or additions to documentation js config labels Jun 23, 2025
@pavelgj pavelgj requested a review from mbleigh June 23, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config docs Improvements or additions to documentation js
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants