Skip to main content
In this lesson we’ll connect to and use an existing MCP (Model Context Protocol) server. You’ll learn how to locate the server code in the workspace, register it with the RooCode MCP plugin, and run a simple query (searching flights) through the chat assistant.
A split-screen developer workspace: the left panel shows a lab task titled "MCP Server Exploration – Flight Booking System" with instructions, and the right panel displays Visual Studio Code open to a README welcoming users to KodeKloud OpenAI Labs.
Quick orientation question: What transport modes does MCP support?
A dark-mode quiz screen asks "What are the transport modes supported in MCP?" with four answer buttons (WebSocket and REST; HTTP and STDIO; TCP and UDP; FTP and SSH) and a pointing-hand emoji selecting "HTTP and STDIO." A code editor/Explorer pane (showing a flight-booking-server folder) is visible on the right.
Repository inspection Open the workspace file explorer and locate the flight-booking-server folder. A typical listing in the workspace looks like this:
The multiple-choice task asks which files are present inside flight-booking-server. The important files for this lesson are server.py (the MCP server code) and pyproject.toml (dependency and project metadata). Open server.py to inspect how resources and tools are exposed via MCP. You’ll see resource decorators similar to these:
You don’t need to memorize every line in server.py right now — the focus here is registering and using the MCP server. We’ll look at relevant functions as needed when you query the server.
Minimal server setup For context, the server in this project uses FastMCP to register resource endpoints. A condensed version of the setup looks like this:
Registering the MCP server with RooCode To let the RooCode assistant discover and call the local server, you add an MCP server entry in the RooCode MCP configuration. The configuration maps a friendly name to the command used to start the server and its working directory. In this lab the configuration is:
Explanation:
  • command: the program RooCode will invoke (uv in this environment).
  • args: the arguments to run the Python server (here, run python server.py).
  • cwd: the working directory where server.py is located.
Steps to connect the server in RooCode
  1. Open the RooCode extension/plugin in your workspace.
  2. Go to the “MCP servers” section and choose “Add Project MCP”.
  3. Paste the JSON configuration (above) into the configuration field and save.
  4. Refresh the MCP Servers list. The “flight-booking” entry should appear and show a green/success status when detected.
  5. Expand the server entry to view tools and resources discovered from server.py.
Security reminder
When the assistant requests to use an MCP server you must approve the access. Only approve servers and configurations from trusted projects — the assistant will run server-side code on your behalf.
Querying the MCP server from RooCode Once the MCP server is registered and running, you can ask RooCode to perform actions that use server-side resources. For example, in the chat input send: Search for flights from LAX to JFK using the flight-booking server. RooCode will detect the configured MCP server, ask for your permission to use it, then execute the relevant resource/tool handlers and return the server-generated result.
A screenshot of a dark-themed developer interface showing a chat/API request panel with the text "Search for flights from LAX to JFK using the flight-booking server," an API Request section, and a message input box. The left edge shows part of a code editor/sidebar and line numbers.
Example server response After you approve access and RooCode calls the server, a typical JSON response might look like:
This indicates the MCP server is reachable and returning structured data for the requested query. Next steps and exploration ideas
  • Inspect server.py to see how resources, tools, and handlers are implemented and how MCP exposes them.
  • Modify or extend resource handlers (e.g., add booking, availability checks) and then reload the MCP entry in RooCode to test changes.
  • Use pyproject.toml to manage dependencies and ensure the environment can run the server.
  • Experiment with HTTP and STDIO modes if you adapt MCP transport options for other integrations.
References
  • Python documentation: https://www.python.org/doc/
  • If you’re using project tooling (like uv/uvicorn), check the respective tool docs for command syntax and options.

Watch Video

Practice Lab