Spaces:
Running
Running
Didier Durand commited on
Commit ·
1ac845d
1
Parent(s): 08ed45c
Fixing various text typos
Browse files
docs/getting-started/installation.mdx
CHANGED
|
@@ -81,7 +81,7 @@ pytest
|
|
| 81 |
|
| 82 |
### Pre-Commit Hooks
|
| 83 |
|
| 84 |
-
FastMCP uses pre-commit to manage code quality, including formatting, linting, and type-safety. All
|
| 85 |
|
| 86 |
```bash
|
| 87 |
uv run pre-commit install
|
|
|
|
| 81 |
|
| 82 |
### Pre-Commit Hooks
|
| 83 |
|
| 84 |
+
FastMCP uses pre-commit to manage code quality, including formatting, linting, and type-safety. All PRs must pass the pre-commit hooks, which are run as a part of the CI process. To install the pre-commit hooks, run:
|
| 85 |
|
| 86 |
```bash
|
| 87 |
uv run pre-commit install
|
docs/getting-started/quickstart.mdx
CHANGED
|
@@ -89,7 +89,7 @@ This lets us run the server with `python my_server.py`, using the default `stdio
|
|
| 89 |
<Tip>
|
| 90 |
Why do we need the `if __name__ == "__main__":` block?
|
| 91 |
|
| 92 |
-
Within the FastMCP ecosystem, this line may be
|
| 93 |
</Tip>
|
| 94 |
|
| 95 |
### Interacting with the Python server
|
|
@@ -124,5 +124,5 @@ fastmcp run my_server.py:mcp
|
|
| 124 |
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.
|
| 125 |
|
| 126 |
<Tip>
|
| 127 |
-
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
|
| 128 |
</Tip>
|
|
|
|
| 89 |
<Tip>
|
| 90 |
Why do we need the `if __name__ == "__main__":` block?
|
| 91 |
|
| 92 |
+
Within the FastMCP ecosystem, this line may be unnecessary. However, including it ensures that your FastMCP server runs for all users and clients in a consistent way and is therefore recommended as best practice.
|
| 93 |
</Tip>
|
| 94 |
|
| 95 |
### Interacting with the Python server
|
|
|
|
| 124 |
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.
|
| 125 |
|
| 126 |
<Tip>
|
| 127 |
+
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 executes 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.
|
| 128 |
</Tip>
|
src/fastmcp/server/proxy.py
CHANGED
|
@@ -124,7 +124,7 @@ class ProxyTemplate(ResourceTemplate):
|
|
| 124 |
params: dict[str, Any],
|
| 125 |
context: Context | None = None,
|
| 126 |
) -> ProxyResource:
|
| 127 |
-
#
|
| 128 |
# uri_template on the remote server.
|
| 129 |
# quote params to ensure they are valid for the uri_template
|
| 130 |
parameterized_uri = self.uri_template.format(
|
|
|
|
| 124 |
params: dict[str, Any],
|
| 125 |
context: Context | None = None,
|
| 126 |
) -> ProxyResource:
|
| 127 |
+
# don't use the provided uri, because it may not be the same as the
|
| 128 |
# uri_template on the remote server.
|
| 129 |
# quote params to ensure they are valid for the uri_template
|
| 130 |
parameterized_uri = self.uri_template.format(
|
src/fastmcp/server/server.py
CHANGED
|
@@ -892,7 +892,7 @@ class FastMCP(Generic[LifespanResultT]):
|
|
| 892 |
future changes to the imported server will not be reflected in the
|
| 893 |
importing server. Server-level configurations and lifespans are not imported.
|
| 894 |
|
| 895 |
-
When
|
| 896 |
using the tool_separator
|
| 897 |
Example: If server has a tool named "get_weather", it will be
|
| 898 |
available as "weatherget_weather"
|
|
|
|
| 892 |
future changes to the imported server will not be reflected in the
|
| 893 |
importing server. Server-level configurations and lifespans are not imported.
|
| 894 |
|
| 895 |
+
When a server is mounted: - The tools are imported with prefixed names
|
| 896 |
using the tool_separator
|
| 897 |
Example: If server has a tool named "get_weather", it will be
|
| 898 |
available as "weatherget_weather"
|