Skip to content

tohure/MCP-Server_FastMCP-Demo

Repository files navigation

MCPDemo with FastMCP

Example for implement MCPServer with FastMCP

Features

  • FastMCP is used as the development framework.
  • Python is used as the language.
  • It was configured to run on VS Code as a client. (.vscode/mcp.json)
  • There are two scripts that allow you to make queries ranging from simple calculations to questions about files and their contents or even navigate en some web pages with Chromium.

Requirements

  • Python >=3.10
  • Github Copilot Chat

Setup

  1. Create the virtual environment (make sure you are using Python 3.10+):

    python3 -m venv .venv
  2. Activate the environment:

    source .venv/bin/activate
  3. Install the required dependencies in your virtual enviroment:

    pip install fastmcp
    pip install playwright
    playwright install chromium

Usage

  1. Make sure your VScode has enabled support for MCP Servers.

    More information here: VSCode MCP Documentation

  2. Change the paths for your script and enviroment python bin (inside file .vscode/mcp.json)

  3. Perform queries in your VScode Copilot chat, such as:

    • What is the sum of 90 and 30?
    • What files are available in my directory?
    • Show me the difference between 780 and 356
    • Whats the content of README.md file
    • I wanted to navigate to https://playwright.dev/ and click the Docs link
    • and so on

Remember that for each request, VScode will ask for permission to use your MCP Server, so it's best to grant permissions only for use within your Workspace. This way, they'll not interfere with other projects.

  1. Enjoy!

by Tohure

About

Example for implement MCPServer with FastMCP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages