loading…
Search for a command to run...
loading…
A simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.
A simple MCP server demonstrating resources, tools, and prompts, including a greeting resource, an addition tool, and a calculation prompt.
First, install the dependencies:
uv install -r requirements.txt
To run the server, execute the following command:
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:
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.
Inside the MCP, we have three main concepts: Resources, Tools, and Prompts.
@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.@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.@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.
Выполни в терминале:
claude mcp add study-mcp -- npx PRs, issues, code search, CI status
автор: GitHubDatabase, auth and storage
автор: SupabaseSecure file operations with configurable access controls.
Reference / test server with prompts, resources, and tools.
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development