mcpField
A
Agent2AgentProtocol_MCP_servers

Agent2AgentProtocol_MCP_servers

Local
github.com/sanikacentricAI & Agents0Updated 79w ago

About Agent2AgentProtocol_MCP_servers

Agent2AgentProtocol_MCP_servers is a Python simulation of travel booking across airline agents and MCP-backed web and database servers. A booking agent gathers offers from multiple providers and sorts them by price using structured messages and mock data.

Key features

  1. 01Simulate airline and booking agents
  2. 02Model web and database servers
  3. 03Exchange structured agent messages
  4. 04Collect and sort service prices
  5. 05Handle offline server errors

Use cases

  1. 01Compare flight prices from multiple airlines
  2. 02Find supported hotel offers
  3. 03Practice modular agent communication in Python

MCP support

The project models MCP servers that respond to requests for service prices. The servers are part of a simulated travel-booking flow between agents.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Building a travel booking system where a user wants to book flights, hotels, or rental cars. In this project, we simulate Travel Agents who connect to Airlines through MCP servers (web and database servers). They communicate using messages, compare prices, and find the best option for customers.

This example shows how different parts — like dataclasses, Enums, servers, and agents — can work together cleanly in Python.

🔥 Steps Involved

  1. Define Common Data Structures We create Enums (ServiceType, MCPType, AgentStatus) to standardize service names and statuses.

A dataclass AgentMessage helps agents send structured information easily (sender, receiver, timestamp, etc.).

  1. Set Up MCP Servers The MCPServer acts like a backend server.

Based on its type (Web or Database), it knows how to respond to different requests like fetching prices.

If the server is offline, it returns an error.

  1. Create Agent Cards AgentCard represents an airline or a service provider.

Each agent has:

A web server

A database server

Services it supports (like flight, hotel)

Its own authentication token.

Agents can generate messages and validate responses from others.

  1. Connect Airline Agents AirlineAgent links an agent card to the airline operations.

It ensures requests from booking agents get passed to the right place.

  1. Set Up a Booking Agent BookingAgent acts like a travel search engine.

It contacts multiple airlines and finds the best price for flights or hotels.

It generates a request → sends it to airlines → collects responses → sorts by cheapest option.

  1. Find Best Options Using find_best_option() method:

Booking agent talks to airlines,

Gathers prices,

Picks the cheapest deal,

Shows the result to the customer.

🛠️ Example Walkthrough In the main program:

We create two airlines (Emirates and Air India) with different prices.

We create one booking agent (TravelMaster) who connects to both airlines.

When a user wants a flight:

TravelMaster sends price-check requests.

Collects responses.

Displays cheapest flights.

👉 Example output:

yaml Copy Edit Best flight options:

  1. AirIndia: 250 USD
  2. Emirates: 300 USD (Hotel options show empty because Air India doesn't offer hotels.)

📝 Summary

Part Role ServiceType, MCPType, AgentStatus To define standard terms AgentMessage To structure communication MCPServer To handle backend services AgentCard Represents a service provider AirlineAgent Connects airline to agents BookingAgent Finds best travel options The system behaves like a mini real-world booking portal, but in a very simple and understandable way.

🏁 Conclusion This project shows how you can simulate real-world agent communication in Python using clean coding principles like: ✅ Modular Classes ✅ Dataclasses for Messages ✅ Enum for Status Management ✅ Easy Agent Communication ✅ Smart Server Handling

Even though it’s simple, this design is very powerful to extend into a full-fledged application later (like adding real-time bookings, payment systems, etc.).

🌟 Benefits of this Design Separation of Concerns: Each class handles its own responsibility (server, agent, booking).

Scalable: Easy to add more airlines, hotels, or rental services.

Error Handling: Servers return error messages when not available.

Structured Communication: Message passing is clear and consistent.

Mock Data: Easy to test without needing real APIs.

Real-world Practice: Mimics actual web service communication flow.

Comments

Markdown supported

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.