mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Update schema path (#1595)
This commit is contained in:
parent
6c51dad870
commit
b34519c356
22 changed files with 654 additions and 138 deletions
|
|
@ -33,7 +33,7 @@ FastMCP provides JSON schemas for IDE autocomplete and validation. Add the schem
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -42,8 +42,8 @@ FastMCP provides JSON schemas for IDE autocomplete and validation. Add the schem
|
|||
```
|
||||
|
||||
Two schema URLs are available:
|
||||
- **Version-specific**: `https://gofastmcp.com/schemas/fastmcp_config/v1.json`
|
||||
- **Latest version**: `https://gofastmcp.com/schemas/fastmcp_config/latest.json`
|
||||
- **Version-specific**: `https://gofastmcp.com/public/schemas/fastmcp.json/v1.json`
|
||||
- **Latest version**: `https://gofastmcp.com/public/schemas/fastmcp.json/latest.json`
|
||||
|
||||
Modern IDEs like VS Code will automatically provide autocomplete suggestions, validation, and inline documentation when the schema is specified.
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ The `fastmcp.json` file has three main sections, each controlling a different as
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -261,7 +261,7 @@ A minimal configuration for a simple server:
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -276,7 +276,7 @@ A configuration optimized for local development:
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "src/server.py:app",
|
||||
"environment": {
|
||||
"python": "3.12",
|
||||
|
|
@ -302,7 +302,7 @@ A production-ready configuration with full dependency management:
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "app/main.py",
|
||||
"object": "mcp_server"
|
||||
|
|
@ -335,7 +335,7 @@ Configuration for a data analysis server with scientific packages:
|
|||
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "analysis_server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -367,7 +367,7 @@ You can maintain multiple configuration files for different environments:
|
|||
**dev.fastmcp.json**:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -382,7 +382,7 @@ You can maintain multiple configuration files for different environments:
|
|||
**prod.fastmcp.json**:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
@ -515,7 +515,7 @@ uv run --with pandas --with requests \
|
|||
**Equivalent fastmcp.json**:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ Alternatively, you can use a `fastmcp.json` configuration file (recommended):
|
|||
|
||||
```json fastmcp.json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ Alternatively, you can use a `fastmcp.json` configuration file (recommended):
|
|||
|
||||
```json fastmcp.json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ Alternatively, you can use a `fastmcp.json` configuration file (recommended):
|
|||
|
||||
```json fastmcp.json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ You can also use a `fastmcp.json` configuration file (recommended):
|
|||
|
||||
```json fastmcp.json
|
||||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
|
|
|
|||
296
docs/public/schemas/fastmcp-json/latest.json
Normal file
296
docs/public/schemas/fastmcp-json/latest.json
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
{
|
||||
"$defs": {
|
||||
"DeploymentConfig": {
|
||||
"description": "Configuration for server deployment and runtime settings.",
|
||||
"properties": {
|
||||
"transport": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": ["stdio", "http", "sse"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Transport protocol to use",
|
||||
"title": "Transport"
|
||||
},
|
||||
"host": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Host to bind to when using HTTP transport",
|
||||
"examples": ["127.0.0.1", "0.0.0.0", "localhost"],
|
||||
"title": "Host"
|
||||
},
|
||||
"port": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Port to bind to when using HTTP transport",
|
||||
"examples": [8000, 3000, 5000],
|
||||
"title": "Port"
|
||||
},
|
||||
"path": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "URL path for the server endpoint",
|
||||
"examples": ["/mcp/", "/api/mcp/", "/sse/"],
|
||||
"title": "Path"
|
||||
},
|
||||
"log_level": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Log level for the server",
|
||||
"title": "Log Level"
|
||||
},
|
||||
"cwd": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Working directory for the server process",
|
||||
"examples": [".", "./src", "/app"],
|
||||
"title": "Cwd"
|
||||
},
|
||||
"env": {
|
||||
"anyOf": [
|
||||
{
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Environment variables to set when running the server",
|
||||
"examples": [
|
||||
{
|
||||
"API_KEY": "secret",
|
||||
"DEBUG": "true"
|
||||
}
|
||||
],
|
||||
"title": "Env"
|
||||
},
|
||||
"args": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Arguments to pass to the server (after --)",
|
||||
"examples": [["--config", "config.json", "--debug"]],
|
||||
"title": "Args"
|
||||
}
|
||||
},
|
||||
"title": "DeploymentConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"EntrypointConfig": {
|
||||
"description": "Configuration for server entrypoint when using object format.",
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path to Python file containing the server",
|
||||
"examples": ["server.py", "src/server.py", "app/main.py"],
|
||||
"title": "File",
|
||||
"type": "string"
|
||||
},
|
||||
"object": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Name of the server object in the file (defaults to searching for mcp/server/app)",
|
||||
"examples": ["app", "mcp", "server"],
|
||||
"title": "Object"
|
||||
},
|
||||
"repo": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Git repository URL",
|
||||
"examples": ["https://github.com/user/repo"],
|
||||
"title": "Repo"
|
||||
}
|
||||
},
|
||||
"required": ["file"],
|
||||
"title": "EntrypointConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"EnvironmentConfig": {
|
||||
"description": "Configuration for Python environment setup.",
|
||||
"properties": {
|
||||
"python": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Python version constraint",
|
||||
"examples": ["3.10", "3.11", "3.12"],
|
||||
"title": "Python"
|
||||
},
|
||||
"dependencies": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Python packages to install with PEP 508 specifiers",
|
||||
"examples": [["fastmcp>=2.0,<3", "httpx", "pandas>=2.0"]],
|
||||
"title": "Dependencies"
|
||||
},
|
||||
"requirements": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Path to requirements.txt file",
|
||||
"examples": ["requirements.txt", "../requirements/prod.txt"],
|
||||
"title": "Requirements"
|
||||
},
|
||||
"project": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Path to project directory containing pyproject.toml",
|
||||
"examples": [".", "../my-project"],
|
||||
"title": "Project"
|
||||
},
|
||||
"editable": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Directory to install in editable mode",
|
||||
"examples": [".", "../my-package"],
|
||||
"title": "Editable"
|
||||
}
|
||||
},
|
||||
"title": "EnvironmentConfig",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"description": "Configuration file for FastMCP servers",
|
||||
"properties": {
|
||||
"$schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"description": "JSON schema for IDE support and validation",
|
||||
"title": "$Schema"
|
||||
},
|
||||
"entrypoint": {
|
||||
"$ref": "#/$defs/EntrypointConfig",
|
||||
"description": "Server entrypoint as a string (file or file:object) or object with file/object/repo",
|
||||
"examples": [
|
||||
"server.py",
|
||||
"server.py:app",
|
||||
{
|
||||
"file": "src/server.py",
|
||||
"object": "app"
|
||||
}
|
||||
]
|
||||
},
|
||||
"environment": {
|
||||
"$ref": "#/$defs/EnvironmentConfig",
|
||||
"description": "Python environment setup configuration"
|
||||
},
|
||||
"deployment": {
|
||||
"$ref": "#/$defs/DeploymentConfig",
|
||||
"description": "Server deployment and runtime settings"
|
||||
}
|
||||
},
|
||||
"required": ["entrypoint"],
|
||||
"title": "FastMCP Configuration",
|
||||
"type": "object",
|
||||
"$id": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json"
|
||||
}
|
||||
296
docs/public/schemas/fastmcp-json/v1.json
Normal file
296
docs/public/schemas/fastmcp-json/v1.json
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
{
|
||||
"$defs": {
|
||||
"DeploymentConfig": {
|
||||
"description": "Configuration for server deployment and runtime settings.",
|
||||
"properties": {
|
||||
"transport": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": ["stdio", "http", "sse"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Transport protocol to use",
|
||||
"title": "Transport"
|
||||
},
|
||||
"host": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Host to bind to when using HTTP transport",
|
||||
"examples": ["127.0.0.1", "0.0.0.0", "localhost"],
|
||||
"title": "Host"
|
||||
},
|
||||
"port": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Port to bind to when using HTTP transport",
|
||||
"examples": [8000, 3000, 5000],
|
||||
"title": "Port"
|
||||
},
|
||||
"path": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "URL path for the server endpoint",
|
||||
"examples": ["/mcp/", "/api/mcp/", "/sse/"],
|
||||
"title": "Path"
|
||||
},
|
||||
"log_level": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Log level for the server",
|
||||
"title": "Log Level"
|
||||
},
|
||||
"cwd": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Working directory for the server process",
|
||||
"examples": [".", "./src", "/app"],
|
||||
"title": "Cwd"
|
||||
},
|
||||
"env": {
|
||||
"anyOf": [
|
||||
{
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Environment variables to set when running the server",
|
||||
"examples": [
|
||||
{
|
||||
"API_KEY": "secret",
|
||||
"DEBUG": "true"
|
||||
}
|
||||
],
|
||||
"title": "Env"
|
||||
},
|
||||
"args": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Arguments to pass to the server (after --)",
|
||||
"examples": [["--config", "config.json", "--debug"]],
|
||||
"title": "Args"
|
||||
}
|
||||
},
|
||||
"title": "DeploymentConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"EntrypointConfig": {
|
||||
"description": "Configuration for server entrypoint when using object format.",
|
||||
"properties": {
|
||||
"file": {
|
||||
"description": "Path to Python file containing the server",
|
||||
"examples": ["server.py", "src/server.py", "app/main.py"],
|
||||
"title": "File",
|
||||
"type": "string"
|
||||
},
|
||||
"object": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Name of the server object in the file (defaults to searching for mcp/server/app)",
|
||||
"examples": ["app", "mcp", "server"],
|
||||
"title": "Object"
|
||||
},
|
||||
"repo": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Git repository URL",
|
||||
"examples": ["https://github.com/user/repo"],
|
||||
"title": "Repo"
|
||||
}
|
||||
},
|
||||
"required": ["file"],
|
||||
"title": "EntrypointConfig",
|
||||
"type": "object"
|
||||
},
|
||||
"EnvironmentConfig": {
|
||||
"description": "Configuration for Python environment setup.",
|
||||
"properties": {
|
||||
"python": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Python version constraint",
|
||||
"examples": ["3.10", "3.11", "3.12"],
|
||||
"title": "Python"
|
||||
},
|
||||
"dependencies": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Python packages to install with PEP 508 specifiers",
|
||||
"examples": [["fastmcp>=2.0,<3", "httpx", "pandas>=2.0"]],
|
||||
"title": "Dependencies"
|
||||
},
|
||||
"requirements": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Path to requirements.txt file",
|
||||
"examples": ["requirements.txt", "../requirements/prod.txt"],
|
||||
"title": "Requirements"
|
||||
},
|
||||
"project": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Path to project directory containing pyproject.toml",
|
||||
"examples": [".", "../my-project"],
|
||||
"title": "Project"
|
||||
},
|
||||
"editable": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"description": "Directory to install in editable mode",
|
||||
"examples": [".", "../my-package"],
|
||||
"title": "Editable"
|
||||
}
|
||||
},
|
||||
"title": "EnvironmentConfig",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"description": "Configuration file for FastMCP servers",
|
||||
"properties": {
|
||||
"$schema": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"description": "JSON schema for IDE support and validation",
|
||||
"title": "$Schema"
|
||||
},
|
||||
"entrypoint": {
|
||||
"$ref": "#/$defs/EntrypointConfig",
|
||||
"description": "Server entrypoint as a string (file or file:object) or object with file/object/repo",
|
||||
"examples": [
|
||||
"server.py",
|
||||
"server.py:app",
|
||||
{
|
||||
"file": "src/server.py",
|
||||
"object": "app"
|
||||
}
|
||||
]
|
||||
},
|
||||
"environment": {
|
||||
"$ref": "#/$defs/EnvironmentConfig",
|
||||
"description": "Python environment setup configuration"
|
||||
},
|
||||
"deployment": {
|
||||
"$ref": "#/$defs/DeploymentConfig",
|
||||
"description": "Server deployment and runtime settings"
|
||||
}
|
||||
},
|
||||
"required": ["entrypoint"],
|
||||
"title": "FastMCP Configuration",
|
||||
"type": "object",
|
||||
"$id": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json"
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "src/atproto_mcp/server.py",
|
||||
"environment": {
|
||||
"dependencies": [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "src/server.py:app",
|
||||
"environment": {
|
||||
"python": "3.12",
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {
|
||||
"file": "server.py",
|
||||
"object": "mcp"
|
||||
},
|
||||
"environment": {
|
||||
"python": "3.12",
|
||||
"dependencies": [
|
||||
"requests>=2.31.0",
|
||||
"httpx"
|
||||
],
|
||||
"dependencies": ["requests>=2.31.0", "httpx"],
|
||||
"requirements": null,
|
||||
"project": null,
|
||||
"editable": null
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "server.py",
|
||||
"environment": {
|
||||
"python": "3.11",
|
||||
"dependencies": [
|
||||
"pyautogui",
|
||||
"Pillow"
|
||||
]
|
||||
"dependencies": ["pyautogui", "Pillow"]
|
||||
},
|
||||
"deployment": {
|
||||
"transport": "stdio",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,7 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "memory.py",
|
||||
"environment": {
|
||||
"dependencies": [
|
||||
"pydantic-ai-slim[openai]",
|
||||
"asyncpg",
|
||||
"numpy",
|
||||
"pgvector"
|
||||
]
|
||||
"dependencies": ["pydantic-ai-slim[openai]", "asyncpg", "numpy", "pgvector"]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "mount_example.py"
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "screenshot.py",
|
||||
"environment": {
|
||||
"dependencies": ["pyautogui", "Pillow"]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "src/smart_home/hub.py",
|
||||
"environment": {
|
||||
"dependencies": [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "src/smart_home/lights/server.py",
|
||||
"environment": {
|
||||
"dependencies": [
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ from fastmcp.utilities.logging import get_logger
|
|||
logger = get_logger("cli.config")
|
||||
|
||||
# JSON Schema for IDE support
|
||||
FASTMCP_JSON_SCHEMA = "https://gofastmcp.com/schemas/fastmcp_config/v1.json"
|
||||
FASTMCP_JSON_SCHEMA = "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json"
|
||||
|
||||
|
||||
class EntrypointConfig(BaseModel):
|
||||
|
|
@ -324,7 +324,7 @@ class FastMCPConfig(BaseModel):
|
|||
|
||||
# Schema field for IDE support
|
||||
schema_: str | None = Field(
|
||||
default="https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
default="https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
alias="$schema",
|
||||
description="JSON schema for IDE support and validation",
|
||||
)
|
||||
|
|
|
|||
|
|
@ -6,11 +6,7 @@
|
|||
"transport": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"stdio",
|
||||
"http",
|
||||
"sse"
|
||||
],
|
||||
"enum": ["stdio", "http", "sse"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
|
|
@ -32,11 +28,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Host to bind to when using HTTP transport",
|
||||
"examples": [
|
||||
"127.0.0.1",
|
||||
"0.0.0.0",
|
||||
"localhost"
|
||||
],
|
||||
"examples": ["127.0.0.1", "0.0.0.0", "localhost"],
|
||||
"title": "Host"
|
||||
},
|
||||
"port": {
|
||||
|
|
@ -50,11 +42,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Port to bind to when using HTTP transport",
|
||||
"examples": [
|
||||
8000,
|
||||
3000,
|
||||
5000
|
||||
],
|
||||
"examples": [8000, 3000, 5000],
|
||||
"title": "Port"
|
||||
},
|
||||
"path": {
|
||||
|
|
@ -68,23 +56,13 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "URL path for the server endpoint",
|
||||
"examples": [
|
||||
"/mcp/",
|
||||
"/api/mcp/",
|
||||
"/sse/"
|
||||
],
|
||||
"examples": ["/mcp/", "/api/mcp/", "/sse/"],
|
||||
"title": "Path"
|
||||
},
|
||||
"log_level": {
|
||||
"anyOf": [
|
||||
{
|
||||
"enum": [
|
||||
"DEBUG",
|
||||
"INFO",
|
||||
"WARNING",
|
||||
"ERROR",
|
||||
"CRITICAL"
|
||||
],
|
||||
"enum": ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
|
|
@ -106,11 +84,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Working directory for the server process",
|
||||
"examples": [
|
||||
".",
|
||||
"./src",
|
||||
"/app"
|
||||
],
|
||||
"examples": [".", "./src", "/app"],
|
||||
"title": "Cwd"
|
||||
},
|
||||
"env": {
|
||||
|
|
@ -149,13 +123,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Arguments to pass to the server (after --)",
|
||||
"examples": [
|
||||
[
|
||||
"--config",
|
||||
"config.json",
|
||||
"--debug"
|
||||
]
|
||||
],
|
||||
"examples": [["--config", "config.json", "--debug"]],
|
||||
"title": "Args"
|
||||
}
|
||||
},
|
||||
|
|
@ -167,11 +135,7 @@
|
|||
"properties": {
|
||||
"file": {
|
||||
"description": "Path to Python file containing the server",
|
||||
"examples": [
|
||||
"server.py",
|
||||
"src/server.py",
|
||||
"app/main.py"
|
||||
],
|
||||
"examples": ["server.py", "src/server.py", "app/main.py"],
|
||||
"title": "File",
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -186,11 +150,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Name of the server object in the file (defaults to searching for mcp/server/app)",
|
||||
"examples": [
|
||||
"app",
|
||||
"mcp",
|
||||
"server"
|
||||
],
|
||||
"examples": ["app", "mcp", "server"],
|
||||
"title": "Object"
|
||||
},
|
||||
"repo": {
|
||||
|
|
@ -204,15 +164,11 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Git repository URL",
|
||||
"examples": [
|
||||
"https://github.com/user/repo"
|
||||
],
|
||||
"examples": ["https://github.com/user/repo"],
|
||||
"title": "Repo"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
],
|
||||
"required": ["file"],
|
||||
"title": "EntrypointConfig",
|
||||
"type": "object"
|
||||
},
|
||||
|
|
@ -230,11 +186,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Python version constraint",
|
||||
"examples": [
|
||||
"3.10",
|
||||
"3.11",
|
||||
"3.12"
|
||||
],
|
||||
"examples": ["3.10", "3.11", "3.12"],
|
||||
"title": "Python"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
@ -251,13 +203,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Python packages to install with PEP 508 specifiers",
|
||||
"examples": [
|
||||
[
|
||||
"fastmcp>=2.0,<3",
|
||||
"httpx",
|
||||
"pandas>=2.0"
|
||||
]
|
||||
],
|
||||
"examples": [["fastmcp>=2.0,<3", "httpx", "pandas>=2.0"]],
|
||||
"title": "Dependencies"
|
||||
},
|
||||
"requirements": {
|
||||
|
|
@ -271,10 +217,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Path to requirements.txt file",
|
||||
"examples": [
|
||||
"requirements.txt",
|
||||
"../requirements/prod.txt"
|
||||
],
|
||||
"examples": ["requirements.txt", "../requirements/prod.txt"],
|
||||
"title": "Requirements"
|
||||
},
|
||||
"project": {
|
||||
|
|
@ -288,10 +231,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Path to project directory containing pyproject.toml",
|
||||
"examples": [
|
||||
".",
|
||||
"../my-project"
|
||||
],
|
||||
"examples": [".", "../my-project"],
|
||||
"title": "Project"
|
||||
},
|
||||
"editable": {
|
||||
|
|
@ -305,10 +245,7 @@
|
|||
],
|
||||
"default": null,
|
||||
"description": "Directory to install in editable mode",
|
||||
"examples": [
|
||||
".",
|
||||
"../my-package"
|
||||
],
|
||||
"examples": [".", "../my-package"],
|
||||
"title": "Editable"
|
||||
}
|
||||
},
|
||||
|
|
@ -327,7 +264,7 @@
|
|||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"default": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"description": "JSON schema for IDE support and validation",
|
||||
"title": "$Schema"
|
||||
},
|
||||
|
|
@ -352,10 +289,8 @@
|
|||
"description": "Server deployment and runtime settings"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"entrypoint"
|
||||
],
|
||||
"required": ["entrypoint"],
|
||||
"title": "FastMCP Configuration",
|
||||
"type": "object",
|
||||
"$id": "https://gofastmcp.com/schemas/fastmcp_config/v1.json"
|
||||
"$id": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json"
|
||||
}
|
||||
|
|
@ -365,7 +365,7 @@ class TestFastMCPConfig:
|
|||
def test_from_file(self, tmp_path):
|
||||
"""Test loading config from JSON file with nested structure."""
|
||||
config_data = {
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": {"file": "src/server.py", "object": "app"},
|
||||
"environment": {"python": "3.12", "dependencies": ["requests"]},
|
||||
"deployment": {"transport": "http", "port": 8000},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ if __name__ == "__main__":
|
|||
|
||||
# Create config file
|
||||
config_data = {
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "server.py",
|
||||
"environment": {
|
||||
"python": sys.version.split()[0], # Use current Python version
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ def test_schema_has_correct_id():
|
|||
assert "$id" in generated_schema
|
||||
assert (
|
||||
generated_schema["$id"]
|
||||
== "https://gofastmcp.com/schemas/fastmcp_config/v1.json"
|
||||
== "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json"
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ from fastmcp.utilities.fastmcp_config import (
|
|||
def sample_config(tmp_path):
|
||||
"""Create a sample fastmcp.json configuration file with nested structure."""
|
||||
config_data = {
|
||||
"$schema": "https://gofastmcp.com/schemas/fastmcp_config/v1.json",
|
||||
"$schema": "https://gofastmcp.com/public/schemas/fastmcp.json/v1.json",
|
||||
"entrypoint": "server.py",
|
||||
"environment": {"python": "3.11", "dependencies": ["requests"]},
|
||||
"deployment": {"transport": "stdio", "env": {"TEST_VAR": "test_value"}},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue