mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-08-17 20:03:08 +00:00
Improve example MCP server
This commit is contained in:
parent
8589035d64
commit
c38e27b097
2 changed files with 2 additions and 5 deletions
|
@ -4,9 +4,7 @@ Use this example MCP server, if you don't already have an MCP server to test the
|
||||||
|
|
||||||
## Setting Up
|
## Setting Up
|
||||||
|
|
||||||
1. Navigate to the `resources` directory
|
1. Set up a Python virtual environment.
|
||||||
|
|
||||||
2. Set up a Python environment:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
|
@ -14,7 +12,7 @@ source .venv/bin/activate
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Start the example server:
|
2. Start the example server.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 echo_server.py
|
python3 echo_server.py
|
||||||
|
|
|
@ -2,7 +2,6 @@ from mcp.server.fastmcp import FastMCP
|
||||||
|
|
||||||
mcp = FastMCP("Echo")
|
mcp = FastMCP("Echo")
|
||||||
|
|
||||||
|
|
||||||
@mcp.resource("echo://{message}")
|
@mcp.resource("echo://{message}")
|
||||||
def echo_resource(message: str) -> str:
|
def echo_resource(message: str) -> str:
|
||||||
"""Echo a message as a resource"""
|
"""Echo a message as a resource"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue