MCP ExplorerExplorer

Remote Mcp Agent

@allenheltondevon 10 months ago
2 MIT
FreeCommunity
AI Systems
Example repository of how to create an AI agent using LangChain and a remote MCP server

Overview

What is Remote Mcp Agent

remote-mcp-agent is an example repository demonstrating how to create an AI agent using LangChain that interacts with remote MCP servers.

Use cases

Use cases include automating tasks via AI agents, configuring and managing remote MCP servers, and integrating AI functionalities into applications.

How to use

To use remote-mcp-agent, set up a Cloudflare account to deploy the MCP server, then run ‘npm run deploy’ in the mcp folder. Additionally, deploy AWS Lambda functions using ‘sam build’ and ‘sam deploy --guided’ to access a public API for configuring MCP servers.

Key features

Key features include dynamic AI agent creation using LangChain, integration with OpenAI for task execution, and a public API for managing MCP server configurations.

Where to use

remote-mcp-agent can be used in various fields such as AI development, cloud computing, and server management, particularly where AI agents need to interact with remote services.

Content

Remote MCP Agent

This repository implements a Model Context Protocol (MCP) agent that can be deployed as a remote service. The agent architecture is designed to work with Cloudflare Workers and integrates with various AI models and services.

Project Structure

The project is organized into several key components:

  • garden-agent: Implementation of the Garden Agent, which handles AI requests and responses
  • mcp/animal: Animal-specific MCP implementation
  • mcp/garden: Garden-specific MCP implementation
  • a2a: Agent-to-Agent communication framework

Key Features

  • Integration with Momento for caching and state management
  • Support for various AI models from providers like Meta (Llama), Hugging Face, and others
  • Cloudflare Workers-based deployment
  • R2 storage integration for object storage
  • WebSocket support for real-time communication

Technologies Used

  • TypeScript
  • Cloudflare Workers
  • Momento Cache
  • Various AI models including:
    • Meta Llama models (Llama 3, Llama 4 Scout)
    • Hugging Face models
    • Stability AI models
    • BAAI embedding models
    • And more

Getting Started

To run this project, you’ll need:

  1. Cloudflare Workers account
  2. Momento API key
  3. Anthropic API key

Environment Variables

The following environment variables are required:

  • MOMENTO_API_KEY: API key for Momento cache
  • ANTHROPIC_KEY: API key for Anthropic AI services

Deployment

The agent is designed to be deployed as a Cloudflare Worker. The main entry point is in garden-agent/src/index.ts.

Usage

The agent exposes an HTTP endpoint that can be called to interact with the MCP agent. The agent handles requests through the A2A (Agent-to-Agent) server implementation.

// Example of how the agent is initialized
const agentExecutor = new GardenAgent(anthropicApiKey);
const requestHandler = new MomentoRequestHandler(
  agentCard,
  agentExecutor,
  {
    cacheName: 'mcp',
    momentoApiKey,
    waitForAgentOnTaskCancellation: true,
  },
);

License

[Add license information here]

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers