fastmcp 0.2.0__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,143 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: fastmcp
3
- Version: 0.2.0
4
- Summary: A more ergonomic interface for MCP servers
5
- Author: Jeremiah Lowin
6
- License: Apache-2.0
7
- Requires-Python: >=3.10
8
- Description-Content-Type: text/markdown
9
- Requires-Dist: httpx>=0.26.0
10
- Requires-Dist: mcp>=1.0.0
11
- Requires-Dist: pydantic-settings>=2.6.1
12
- Requires-Dist: pydantic>=2.5.3
13
- Requires-Dist: typer>=0.9.0
14
-
15
- # FastMCP
16
-
17
- > **Note**: This is experimental software. The Model Context Protocol itself is only a few days old and the specification is still evolving.
18
-
19
- A fast, pythonic way to build Model Context Protocol (MCP) servers.
20
-
21
- The Model Context Protocol is an extremely powerful way to give LLMs access to tools and resources. However, building MCP servers can be difficult and cumbersome. FastMCP provides a simple, intuitive interface for creating MCP servers in Python.
22
-
23
- ## Installation
24
-
25
- MCP servers require you to use [uv](https://github.com/astral-sh/uv) as your dependency manager.
26
-
27
-
28
- Install uv with brew:
29
- ```bash
30
- brew install uv
31
- ```
32
- *(Editor's note: I was unable to get MCP servers working unless uv was installed with brew.)*
33
-
34
- Install FastMCP:
35
- ```bash
36
- uv pip install fastmcp
37
- ```
38
-
39
-
40
-
41
- ## Quick Start
42
-
43
- Here's a simple example that exposes your desktop directory as a resource and provides a basic addition tool:
44
-
45
- ```python
46
- from pathlib import Path
47
- from fastmcp import FastMCP
48
-
49
- # Create server
50
- mcp = FastMCP("Demo")
51
-
52
- @mcp.resource("dir://desktop")
53
- def desktop() -> list[str]:
54
- """List the files in the user's desktop"""
55
- desktop = Path.home() / "Desktop"
56
- return [str(f) for f in desktop.iterdir()]
57
-
58
- @mcp.tool()
59
- def add(a: int, b: int) -> int:
60
- """Add two numbers"""
61
- return a + b
62
-
63
- if __name__ == "__main__":
64
- mcp.run()
65
- ```
66
-
67
- ## Features
68
-
69
- ### Resources
70
-
71
- Resources are data sources that can be accessed by the LLM. They can be files, directories, or any other data source. Resources are defined using the `@resource` decorator:
72
-
73
- ```python
74
- @mcp.resource("file://config.json")
75
- def get_config() -> str:
76
- """Read the config file"""
77
- return Path("config.json").read_text()
78
- ```
79
-
80
- ### Tools
81
-
82
- Tools are functions that can be called by the LLM. They are defined using the `@tool` decorator:
83
-
84
- ```python
85
- @mcp.tool()
86
- def calculate(x: int, y: int) -> int:
87
- """Perform a calculation"""
88
- return x + y
89
- ```
90
-
91
- ## Development
92
-
93
- ### Running the Dev Inspector
94
-
95
- FastMCP includes a development server with the MCP Inspector for testing your server:
96
-
97
- ```bash
98
- # Basic usage
99
- fastmcp dev your_server.py
100
-
101
- # Install package in editable mode from current directory
102
- fastmcp dev your_server.py --with-editable .
103
-
104
- # Install additional packages
105
- fastmcp dev your_server.py --with pandas --with numpy
106
-
107
- # Combine both
108
- fastmcp dev your_server.py --with-editable . --with pandas --with numpy
109
- ```
110
-
111
- The `--with` flag automatically includes `fastmcp` and any additional packages you specify. The `--with-editable` flag installs the package from the specified directory in editable mode, which is useful during development.
112
-
113
- ### Installing in Claude
114
-
115
- To use your server with Claude Desktop:
116
-
117
- ```bash
118
- # Basic usage
119
- fastmcp install your_server.py --name "My Server"
120
-
121
- # Install package in editable mode
122
- fastmcp install your_server.py --with-editable .
123
-
124
- # Install additional packages
125
- fastmcp install your_server.py --with pandas --with numpy
126
-
127
- # Combine options
128
- fastmcp install your_server.py --with-editable . --with pandas --with numpy
129
- ```
130
-
131
-
132
- ## Configuration
133
-
134
- FastMCP can be configured via environment variables with the prefix `FASTMCP_`:
135
-
136
- - `FASTMCP_DEBUG`: Enable debug mode
137
- - `FASTMCP_LOG_LEVEL`: Set logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
138
- - `FASTMCP_HOST`: HTTP server host (default: 0.0.0.0)
139
- - `FASTMCP_PORT`: HTTP server port (default: 8000)
140
-
141
- ## License
142
-
143
- Apache 2.0
@@ -1,17 +0,0 @@
1
- fastmcp/__init__.py,sha256=3E3aQizHaMEwjxRUALigtM5J4lPTvaviMEr4hf975mY,53
2
- fastmcp/_version.py,sha256=H-qsvrxCpdhaQzyddR-yajEqI71hPxLa4KxzpP3uS1g,411
3
- fastmcp/app.py,sha256=RjtnF_4ApkIjxWfQlRmshb03icP6_nlNVV0LKnZGA5w,89
4
- fastmcp/exceptions.py,sha256=K0rCgXsUVlws39hz98Tb4BBf_BzIql_zXFZgqbkNTiE,348
5
- fastmcp/resources.py,sha256=efuEEnir4qCWp8qFrOyQW50sxACcLdKJpnuTZ99eYhM,7708
6
- fastmcp/server.py,sha256=ufsuoUbfGhA5PnGjAlYgxtkv2WRBMwd74duHJ3m58E8,10519
7
- fastmcp/tools.py,sha256=K4NspegydDmEvZyLHw56WyYBU9QHv9D8HsD4nHp_oYA,4858
8
- fastmcp/cli/__init__.py,sha256=RUaBw4rNUJ7CjHrzVazB2jl60E6KA0Wo0x4OqHByL6c,68
9
- fastmcp/cli/claude.py,sha256=rgJWxLPsdqV-UAQenafbAEREsyVuW_PFEyEsX92sHrg,3185
10
- fastmcp/cli/cli.py,sha256=LP6wQ2CMwHURWN8UHq1aUFWN4JveiUr0Ap_dWT4raXI,9627
11
- fastmcp/utilities/__init__.py,sha256=-imJ8S-rXmbXMWeDamldP-dHDqAPg_wwmPVz-LNX14E,31
12
- fastmcp/utilities/logging.py,sha256=t2w5bwtrkxHxioWSy5vY8esxLQxyxN8tfFZ1FI3Cb6E,704
13
- fastmcp-0.2.0.dist-info/METADATA,sha256=PvjUvOjHjrSR3XyJhusgbnn-FXbp99lXXWqKSn43eKY,3730
14
- fastmcp-0.2.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
15
- fastmcp-0.2.0.dist-info/entry_points.txt,sha256=ff8bMtKX1JvXyurMibAacMSKbJEPmac9ffAKU9mLnM8,44
16
- fastmcp-0.2.0.dist-info/top_level.txt,sha256=9NvhdRmSJxxf5iTz58rYyea0DtTsKgvGQHMRZaa7NN4,8
17
- fastmcp-0.2.0.dist-info/RECORD,,
@@ -1 +0,0 @@
1
- fastmcp