From 9d7a6e0684885f0fe796f1452700885b40b7eeff Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Mon, 14 Apr 2025 13:17:52 -0400 Subject: [PATCH 1/2] Fix broken links --- docs/getting-started/quickstart.mdx | 4 ++-- docs/servers/context.mdx | 4 ++-- docs/servers/fastmcp.mdx | 16 ++++++---------- docs/servers/prompts.mdx | 2 +- docs/servers/tools.mdx | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/getting-started/quickstart.mdx b/docs/getting-started/quickstart.mdx index d61636104..b56b5e7bc 100644 --- a/docs/getting-started/quickstart.mdx +++ b/docs/getting-started/quickstart.mdx @@ -5,7 +5,7 @@ icon: rocket Welcome! This guide will help you quickly set up FastMCP and run your first MCP server. -If you haven't already installed FastMCP, follow the [installation instructions](/docs/getting-started/installation). +If you haven't already installed FastMCP, follow the [installation instructions](/getting-started/installation). ## Creating a FastMCP Server @@ -123,5 +123,5 @@ fastmcp run my_server.py:mcp Note that FastMCP *does not* require the `__main__` block in the server file, and will ignore it if it is present. Instead, it looks for the server object provided in the CLI command (here, `mcp`). If no server object is provided, `fastmcp run` will automatically search for servers called "mcp", "app", or "server" in the file. -We pointed our client at the server file, which is recognized as a Python MCP server and executed with `python my_server.py` by default. This exceutes the `__main__` block of the server file. There are other ways to run the server, which are described in the [server configuration](/docs/getting-started/configuration) guide. +We pointed our client at the server file, which is recognized as a Python MCP server and executed with `python my_server.py` by default. This exceutes the `__main__` block of the server file. There are other ways to run the server, which are described in the [server configuration](/servers/fastmcp#running-the-server) guide. diff --git a/docs/servers/context.mdx b/docs/servers/context.mdx index 229cca457..ea0880097 100644 --- a/docs/servers/context.mdx +++ b/docs/servers/context.mdx @@ -5,7 +5,7 @@ description: Access MCP capabilities like logging, progress, and resources withi icon: rectangle-code --- -When defining FastMCP [Tools](/server/tools), your functions might need to interact with the underlying MCP session or access server capabilities. FastMCP provides the `Context` object for this purpose. +When defining FastMCP [tools](/servers/tools), your functions might need to interact with the underlying MCP session or access server capabilities. FastMCP provides the `Context` object for this purpose. ## What Is Context? @@ -227,7 +227,7 @@ async def generate_example(concept: str, ctx: Context) -> str: return f"```python\n{code_example}\n```" ``` -See [Client Sampling](/client/sampling) for more details on how clients handle these requests. +See [Client Sampling](/clients/overview#llm-sampling) for more details on how clients handle these requests. ### Request Information diff --git a/docs/servers/fastmcp.mdx b/docs/servers/fastmcp.mdx index 90cc25b97..cf0fef707 100644 --- a/docs/servers/fastmcp.mdx +++ b/docs/servers/fastmcp.mdx @@ -28,9 +28,9 @@ The `FastMCP` constructor accepts several arguments: * `name`: (Optional) A human-readable name for your server. Defaults to "FastMCP". * `instructions`: (Optional) Description of how to interact with this server. These instructions help clients understand the server's purpose and available functionality. -* `lifespan`: (Optional) An async context manager function for server startup and shutdown logic. See [Lifespan Management](/advanced/lifespan). +* `lifespan`: (Optional) An async context manager function for server startup and shutdown logic. * `tags`: (Optional) A set of strings to tag the server itself. -* `**settings`: Keyword arguments corresponding to `ServerSettings` for configuration. See [Configuration](/advanced/configuration). +* `**settings`: Keyword arguments corresponding to additional `ServerSettings` configuration ## Components @@ -47,7 +47,7 @@ def multiply(a: float, b: float) -> float: return a * b ``` -See [Tools](/server/tools) for detailed documentation. +See [Tools](/servers/tools) for detailed documentation. ### Resources @@ -60,7 +60,7 @@ def get_config() -> dict: return {"theme": "dark", "version": "1.0"} ``` -See [Resources & Templates](/server/resources) for detailed documentation. +See [Resources & Templates](/servers/resources) for detailed documentation. ### Resource Templates @@ -74,7 +74,7 @@ def get_user_profile(user_id: int) -> dict: return {"id": user_id, "name": f"User {user_id}", "status": "active"} ``` -See [Resources & Templates](/server/resources) for detailed documentation. +See [Resources & Templates](/servers/resources) for detailed documentation. ### Prompts @@ -88,7 +88,7 @@ def analyze_data(data_points: list[float]) -> str: return f"Please analyze these data points: {formatted_data}" ``` -See [Prompts](/server/prompts) for detailed documentation. +See [Prompts](/servers/prompts) for detailed documentation. ## Running the Server @@ -186,9 +186,6 @@ fastmcp run my_server.py:mcp --transport sse --host 127.0.0.1 --port 8888 The CLI can dynamically find and run FastMCP server objects in your files, but including the `if __name__ == "__main__":` block ensures compatibility with all clients. - -For more options, including how to set up your server's dependencies or use advanced configurations, see the [CLI Reference](/cli/overview). - ## Mounting Subservers @@ -299,4 +296,3 @@ print(mcp.settings.on_duplicate_tools) # Output: DuplicateBehavior.ERROR All of these can be configured directly as parameters when creating the `FastMCP` instance. -See the [Configuration](/advanced/configuration) page for more details. \ No newline at end of file diff --git a/docs/servers/prompts.mdx b/docs/servers/prompts.mdx index 874061223..6a25d8467 100644 --- a/docs/servers/prompts.mdx +++ b/docs/servers/prompts.mdx @@ -195,7 +195,7 @@ Using the `ctx` parameter (based on its `Context` type hint), you can access: - **LLM Sampling:** `ctx.sample(...)` - **Request Info:** `ctx.request_id`, `ctx.client_id` -Refer to the [Using Context](/server/context) page for more details on these capabilities. +Refer to the [Context documentation](/servers/context) for more details on these capabilities. ## Server Behavior diff --git a/docs/servers/tools.mdx b/docs/servers/tools.mdx index feed85711..ec8633083 100644 --- a/docs/servers/tools.mdx +++ b/docs/servers/tools.mdx @@ -300,7 +300,7 @@ The Context object provides access to: - **LLM Sampling**: `ctx.sample(...)` - **Request Information**: `ctx.request_id`, `ctx.client_id` -For full documentation on the Context object and all its capabilities, see the [Context Object](/server/context) page. +For full documentation on the Context object and all its capabilities, see the [Context documentation](/servers/context). ## Server Behavior From 577af026d63f8e298f9054e3d547bb78a8c559af Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Mon, 14 Apr 2025 13:19:05 -0400 Subject: [PATCH 2/2] Only run static on src changes --- .github/workflows/run-static.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/run-static.yml b/.github/workflows/run-static.yml index 0ff96f68f..9cf63f63d 100644 --- a/.github/workflows/run-static.yml +++ b/.github/workflows/run-static.yml @@ -8,7 +8,19 @@ env: on: push: branches: ["main"] + paths: + - "src/**" + - "tests/**" + - "uv.lock" + - "pyproject.toml" + - ".github/workflows/**" pull_request: + paths: + - "src/**" + - "tests/**" + - "uv.lock" + - "pyproject.toml" + - ".github/workflows/**" workflow_dispatch: permissions: