mcp-on-edge
MCP Client and Server Implementation with Functions
Documentation
EdgeOne Pages: MCP Client and Server Implementation with Functions
Project Overview
This project showcases an intelligent chat application built with EdgeOne Pages Functions technology. It interacts with backend functions through a web interface, implementing a complete Model Context Protocol (MCP) workflow.
The system architecture consists of the following core components:
- MCP Streamable HTTP Server (`functions/mcp-server/index.ts`)
- MCP Client (`functions/mcp-client/index.ts`)
- Backend API (`functions/v1/chat/completions/index.ts`) as the MCP HOST, responsible for coordinating the entire MCP workflow
Through this architecture, users can access powerful MCP tool capabilities in the browser, enabling intelligent interactions such as "generating online webpages with a single prompt."
Core Features
- Interactive Chat Interface: Modern, responsive web interface built with Next.js and React
- High-Performance Edge Functions: Critical business logic deployed on highly scalable EdgeOne Pages Functions
- Complete MCP Implementation: Model Context Protocol implementation based on the latest specifications, providing powerful context management and request routing capabilities
- OpenAI Format Compatible: Backend API fully supports OpenAI-formatted request and response handling
Streamable HTTP MCP Server
Configure remote MCP services in applications that support `Streamable HTTP MCP Server`.
{
"mcpServers": {
"edgeone-pages-mcp-server": {
"url": "https://mcp-on-edge.edgeone.site/mcp-server"
}
}
}Deploy
More Templates: EdgeOne Pages
Local Development
Environment Setup
First, install dependencies and start the development server:
# Install dependencies
npm install
# Or use other package managers
# yarn install / pnpm install / bun install
# Start development server
npm run dev
# Or use other package managers
# yarn dev / pnpm dev / bun devConfigure environment variables: Copy the `.env.example` file and rename it to `.env`, then fill in your AI service interface configuration information.
After starting, visit http://localhost:3000 in your browser to view the application.
Project Structure
- Frontend Interface: `app/page.tsx` contains the main page logic and UI components
- Backend Functions: All edge functions are in the `functions` directory
- Chat API: `functions/v1/chat/completions`
- MCP Server: `functions/mcp-server`
- MCP Client: `functions/mcp-client`
Technical Documentation
Learn more about related technologies:
- Next.js Documentation - Next.js framework features and API
- EdgeOne Pages Functions Documentation - Detailed explanation of EdgeOne serverless functions
- Model Context Protocol (MCP) - Implemented based on the 2025-03-26 version of Streamable HTTP transport
Frequently asked questions
What is mcp-on-edge?
mcp-on-edge is MCP Client and Server Implementation with Functions
How do I install mcp-on-edge?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-on-edge open source?
Yes — it is hosted on GitHub at https://github.com/icyhd/mcp-on-edge.
Related MCP tools
The official TypeScript SDK for Model Context Protocol servers and clients Trusted by 10500+ developers. Trusted by 10500+ developers.
Visual testing tool for MCP servers TypeScript-based implementation. Trusted by 7300+ developers. Trusted by 7300+ developers.
It's like v0 but in your Cursor/WindSurf/Cline. 21st dev Magic MCP server for working with your frontend like Magic TypeScript-based implementation.
Model Context Protocol Server for Mobile Automation and Scraping (iOS, Android, Emulators, Simulators and Real Devices) TypeScript-based implementation.
Https://github.com/user-attachments/assets/364b6705-14d4-4e6d-bea7-fb9f12664fab for the Model Context Protocol. Enhance AI assistants with powerful integrations
MCP server that provides tools and resources for interacting with n8n API TypeScript-based implementation. Trusted by 1400+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP