Skip to content

feat: Add MCP (Model Context Protocol) integration#9

Open
mountstorm wants to merge 1 commit intophoton-hq:mainfrom
mountstorm:feature/mcp-integration
Open

feat: Add MCP (Model Context Protocol) integration#9
mountstorm wants to merge 1 commit intophoton-hq:mainfrom
mountstorm:feature/mcp-integration

Conversation

@mountstorm
Copy link
Copy Markdown

🚀 What This PR Does

Adds full MCP (Model Context Protocol) integration to Flux, enabling agents to connect to ANY MCP server.

Why This Matters

MCP is the new standard for giving AI agents tools (backed by Anthropic, OpenAI, etc). With this PR, Flux agents can now:

  • 📁 Read/write local files
  • 🔍 Search the web
  • 🐙 Interact with GitHub
  • 💾 Query databases
  • 📝 Update Notion

"One integration = infinite capabilities"

What's Included

  • src/mcp/ - Core MCP module
  • client.ts - MCP client wrapper
  • tool-executor.ts - Multi-server tool management
  • agent-wrapper.ts - Flux-compatible agent factory
  • types.ts - TypeScript types
  • examples/mcp/ - Working examples
  • filesystem-agent.ts - File access via iMessage
  • multi-server-agent.ts - Multiple MCP servers
  • research-agent.ts - Web search + file storage
  • tests/mcp/ - Test suite
  • docs/MCP.md - Documentation

Usage

typescript
import { createMCPAgent } from '@photon-ai/flux/mcp';

const agent = await createMCPAgent({
servers: [
{
name: 'filesystem',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem', '.'],
},
],
});

export default agent;

Related

- Add MCP client for connecting to MCP servers
- Add tool executor for managing multiple servers
- Add agent wrapper for Flux compatibility
- Add examples: filesystem, multi-server, research agents
- Add tests for MCP module
- Add documentation

Enables Flux agents to connect to any MCP server for
filesystem, database, web search, GitHub, Notion, and more.
@garygao333
Copy link
Copy Markdown
Collaborator

Thanks for the PR! We'll definitely consider adding this in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants