study-mcp
by Lucs1590
README.md
# Model Context Protocol (MCP)
## Installing Dependencies
First, install the dependencies:
```bash
uv install -r requirements.txt
```
## Running the Server
To run the server, execute the following command:
```bash
uv run main.py
```
After running the server, you must to use or MCP Inspector or any other client to interact with the server. The server will be listening on `http://localhost:8000/mcp`.
To run the MCP Inspector, execute the following command:
```bash
npx -y @modelcontextprotocol/inspector
```
Set the URL to `http://localhost:8000/mcp` and click "Connect". You should see the server's capabilities and be able to send requests to it.
## Concepts
Inside the MCP, we have three main concepts: **Resources**, **Tools**, and **Prompts**.
- **Resources** are used to represent data that can be accessed by the model. They are defined using the `@mcp.resource` decorator and can be accessed using a URL-like syntax. For example, `greetings://{name}` is a resource that generates a personalized greeting based on the provided name.
- **Tools** are functions that perform specific actions or calculations. They are defined using the `@mcp.tool` decorator and can be called by the model to perform tasks. For example, the `add` tool takes two numbers and returns their sum.
- **Prompts** are used to generate prompts for the model. They are defined using the `@mcp.prompt` decorator and can be used to create dynamic prompts based on input parameters. For example, the `calculate_prompt` prompt generates a prompt for performing a mathematical operation based on the provided operation and numbers.
Usually after call a prompt, it will redirect to a resource or a tool, but it can also return a string that can be used as a prompt for the model.
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues