MCP Server logo

MCP Server

by quang-pham-dev

MCP Server is a modern AI service proxy built with Cloudflare Workers and the Hono framework. It supports multiple AI providers including Anthropic Claude and OpenAI.

View on GitHub

Last updated: N/A

What is MCP Server?

MCP Server is an AI service proxy that allows you to integrate with multiple AI providers like Anthropic Claude and OpenAI through a single, unified API. It's built on Cloudflare Workers for global edge deployment, ensuring fast and efficient request handling.

How to use MCP Server?

To use MCP Server, first clone the repository and install the dependencies using pnpm install. Then, configure your environment variables in the .env file with your API keys. Start the development server with pnpm run dev or deploy to Cloudflare Workers with pnpm run deploy. Use the API endpoints such as /health, /api/provider, and /api/mcp to interact with the AI services.

Key features of MCP Server

  • Multi-provider AI service integration (Anthropic Claude, OpenAI)

  • Built on Cloudflare Workers for global edge deployment

  • Fast and efficient request handling with Hono framework

  • Type-safe implementation with TypeScript

  • CORS support for cross-origin requests

  • Health check and provider info endpoints

Use cases of MCP Server

  • Abstracting away the complexities of interacting with multiple AI providers.

  • Creating a unified API for AI services across different platforms.

  • Deploying AI services to the edge for low latency and high availability.

  • Building AI-powered applications that can seamlessly switch between different AI providers based on cost, performance, or availability.

FAQ from MCP Server

What AI providers are supported?

Currently, Anthropic Claude and OpenAI are supported.

What is Cloudflare Workers?

Cloudflare Workers is a serverless execution environment that allows you to deploy code to Cloudflare's global network.

What is the Hono framework?

Hono is a small, fast, and ultra-lightweight web framework for Cloudflare Workers, Deno, Bun, Node.js, and others. It's designed for building APIs and web applications.

How do I configure the API keys?

You need to set the appropriate environment variables in the .env file with your API keys from Anthropic and OpenAI.

How do I deploy the server?

You can deploy the server to Cloudflare Workers using the pnpm run deploy command after properly configuring your Cloudflare account and wrangler.toml file.