Spaces:
Running
Running
feat: add comprehensive server instructions and improve FastMCP configuration
Browse files
app.py
CHANGED
@@ -1,8 +1,42 @@
|
|
1 |
from fastmcp import FastMCP
|
2 |
import requests
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Create a FastMCP 2.0 server instance
|
5 |
-
mcp = FastMCP(
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
@mcp.resource(
|
8 |
uri="resource://sitesgouv-txt",
|
@@ -30,4 +64,4 @@ def get_public_org_domains_csv() -> str:
|
|
30 |
return response.text
|
31 |
|
32 |
if __name__ == "__main__":
|
33 |
-
mcp.run(transport="sse"
|
|
|
1 |
from fastmcp import FastMCP
|
2 |
import requests
|
3 |
|
4 |
+
INSTRUCTIONS="""Official French Government URL List MCP Server
|
5 |
+
|
6 |
+
This server provides access to official French government domain lists and URL resources through the Model Context Protocol.
|
7 |
+
|
8 |
+
## Available Resources
|
9 |
+
|
10 |
+
### 1. Official Government URL List (TXT)
|
11 |
+
- **URI**: `resource://sitesgouv-txt`
|
12 |
+
- **Source**: https://www.auracom.fr/gouv/sitesgouv.txt
|
13 |
+
- **Content**: Raw text file containing official French government URLs
|
14 |
+
|
15 |
+
### 2. Public Organization Domains (CSV)
|
16 |
+
- **URI**: `resource://public-org-domains-csv`
|
17 |
+
- **Source**: https://gitlab.adullact.net/dinum/noms-de-domaine-organismes-secteur-public/-/raw/master/domains.csv
|
18 |
+
- **Content**: CSV file with public organization domain information
|
19 |
+
|
20 |
+
## How to Use
|
21 |
+
|
22 |
+
1. **List Available Resources**: Use `resources/list` to see all available resources
|
23 |
+
2. **Read a Resource**: Use `resources/read` with the resource URI to get the content
|
24 |
+
3. **Get Help**: Use `prompts/get` with name `server-help` for detailed guidance
|
25 |
+
|
26 |
+
## Server Details
|
27 |
+
- **Transport**: SSE (Server-Sent Events)
|
28 |
+
- **Port**: 7860
|
29 |
+
- **Framework**: FastMCP 2.0
|
30 |
+
|
31 |
+
This server is designed to provide easy access to official French government data through the MCP protocol."""
|
32 |
+
|
33 |
# Create a FastMCP 2.0 server instance
|
34 |
+
mcp = FastMCP(
|
35 |
+
"Official Gouv Url List MCP Server",
|
36 |
+
instructions=INSTRUCTIONS,
|
37 |
+
host="0.0.0.0",
|
38 |
+
port=7860
|
39 |
+
)
|
40 |
|
41 |
@mcp.resource(
|
42 |
uri="resource://sitesgouv-txt",
|
|
|
64 |
return response.text
|
65 |
|
66 |
if __name__ == "__main__":
|
67 |
+
mcp.run(transport="sse")
|