
a mcp client_app
一个基于现代技术栈的 MCP 客户端实现,前端使用 Next.js 和 Copilotkit,后端基于 LangGraph。
Repository Info
About This Server
一个基于现代技术栈的 MCP 客户端实现,前端使用 Next.js 和 Copilotkit,后端基于 LangGraph。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Client
项目简介
本项目是一个基于现代技术栈的MCP Client实例:
- 前端:基于 Nextjs 和 Copilotkit CoAgent
- 后端:基于 LangGraph
安装与运行
前端
- 安装依赖:
# 安装Copilotkit相关包
pnpm add @copilotkit/react-ui @copilotkit/react-core @copilotkit/runtime
# 安装项目依赖
pnpm install
- 启动开发服务器:
pnpm dev
- 关键配置文件
app/api/copilotkit:
import {
CopilotRuntime,
copilotRuntimeNextJSAppRouterEndpoint,
ExperimentalEmptyAdapter
} from "@copilotkit/runtime";
import { NextRequest } from "next/server";
// 可以使用任何服务适配器来支持多代理
const serviceAdapter = new ExperimentalEmptyAdapter();
const runtime = new CopilotRuntime({
remoteEndpoints: [
{
url: "http://localhost:8001/mcp",
}
],
});
export const POST = async (req: NextRequest) => {
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
runtime,
serviceAdapter,
endpoint: "/api/copilotkit",
});
return handleRequest(req);
};
重要:需要配置
remoteEndpoints,其中url指向后端 FastAPI 部署的 LangGraph 服务。
后端
- 进入后端目录:
cd agent
- 激活虚拟环境:
source .venv/bin/activate
- 启动服务器:
uv run fastapi_server.py
功能特点
- 后端可以基于 LangGraph 打造复杂 Agent
- 前后端分离架构,便于扩展和维护
- 支持多代理协作
Quick Start
Clone the repository
git clone https://github.com/hfyydd/a-mcp-client_appInstall dependencies
cd a-mcp-client_app
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.