Skip to content

merge-api/agent-handler-chat-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Handler Chat Demo

This repo provides three ready-to-run examples:

  1. chatbot.py β€” Minimal OpenAI chatbot loop (paste your API key and run).
  2. agent_handler.py β€” Implements a custom AgentHandler using Merge MCP's Python SDK.
  3. mcp_client.py β€” Async MCP client that connects to an MCP server, lists tools, and can call them.

πŸš€ Quickstart

# Clone repo
git clone https://github.com/merge-api/agent-handler-chat-demo.git
cd agent-handler-chat-demo

# Install dependencies
pip install -r requirements.txt

# Run chatbot
python chatbot.py

# Run agent handler (server mode)
python agent_handler.py

# Run MCP client
python mcp_client.py

πŸ”‘ Setup

  • Replace your_api_key_here with your OpenAI API key in chatbot.py and agent_handler.py.
  • Replace <auth_token>, <tool_pack_id>, <registered_user_id> in mcp_client.py with your values.

πŸ“ Project Structure

agent-handler-chat-demo/
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ chatbot.py
β”œβ”€β”€ agent_handler.py
└── mcp_client.py

πŸ“„ File Descriptions

  • chatbot.py: Simple interactive chatbot using OpenAI's API
  • agent_handler.py: MCP-compatible agent handler server
  • mcp_client.py: Async MCP client for connecting to MCP servers
  • requirements.txt: Python dependencies
  • README.md: This file with setup instructions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages