About Chat Nextjs Mcp Client
A Next.js chat interface that acts as an MCP client for both Composio-hosted remote servers and locally run MCP servers. It is aimed at developers who want a reference for connecting MCP in Next.js; the README describes it as a demo rather than a production application.
Key features
- 01Next.js App Router chat interface
- 02Support for remote and local MCP servers
- 03Tool calling from AI model chats
- 04Tailwind CSS and shadcn/ui styling
- 05Composio integration setup
Use cases
- 01Learning how to connect an MCP client in Next.js
- 02Calling Gmail, Linear and Slack tools through Composio-hosted servers
- 03Chatting with a local filesystem MCP server
MCP support
The project is an MCP client that connects to Composio-hosted remote MCP servers and locally run MCP servers, and invokes their tools from the chat.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README💬 MCP Chatbot – Composio + Local MCP servers
Built with Composio 🚀
👀 Check Out My Blog Post on this Project!
I have a blog post about this project here.
Brief
Tired of building the same styled AI chatbot apps? This one's different.
It is a fully working chat interface built using Next.js, powered by Model Context Protocol (MCP), capable of connecting to both remote and local MCP servers, with tool-calling support like Cursor and Windsurf.
Note
This is just a simple demo application designed to show you how you can connect to MCP servers in Next.js (Not a production ready application)
Link to the demo: Composio hosted MCP servers, Local filesystem MCP server
🚀 Features
- 🧠 Chat interface powered by AI models
- 🔗 Support for both local and hosted MCP servers
- 🛠️ Tool calling (Gmail, Linear, Slack, etc.)
- 💅 Styled with Tailwind CSS + Shadcn UI
- ⚡ Built with App Router (Next.js 14+)
📦 Tech Stack
- Next.js (App Router, TypeScript)
- Tailwind CSS
- shadcn/ui
- Model Context Protocol (MCP) SDK
- Composio API (for hosted MCP server + integrations)
🛠️ Getting Started
1. Clone the repo
git clone https://github.com/your-username/chat-nextjs-mcp-client.git
cd chat-nextjs-mcp-client
2. Install dependencies
npm install
3. Configure .env
Create a .env file in the root and add your Composio API key:
COMPOSIO_API_KEY=<your_composio_api_key>
OPENAI_API_KEY=sk-<your_openai_api_key>
💡 You can skip this if you're only using local MCP servers.
4. Set up Composio CLI (for remote MCP)
sudo npm install -g composio-core
composio login
# Or, any other integrations you prefer.
composio add gmail
composio add linear
Confirm integrations:
composio integrations
5. Set up local file system MCP server
You are not limited to working with remotely hosted MCP servers from Composio. You can run this application entirely with locally hosted MCP servers.
Note
You can find the steps on how to set local MCP servers on the blog here: Link
🧪 Run the Dev Server
npm run dev
Visit http://localhost:3000 to start chatting!
📁 Folder Structure
.
├── app
│ ├── api
│ ├── favicon.ico
│ ├── globals.css
│ ├── layout.tsx
│ └── page.tsx
├── components
│ ├── ui
│ ├── autoresize-textarea.tsx
│ └── chat.tsx
├── lib
│ ├── mcp-client
│ └── utils.ts
├── public
├── .env.example
├── ... (other config files)
🧠 What is MCP?
Model Context Protocol (MCP) is a protocol for connecting AI models to tools and real-time data sources.
Example Use Cases
- 📧 Send emails
- 🗂️ Create GitHub issues
- 🗓️ Schedule meetings
- 💬 Post to Slack
Read more: modelcontextprotocol.io
🛡️ License
This project is licensed under the MIT License. See the LICENSE file for more details.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.