golf-mcp 0.1.1__tar.gz → 0.1.2__tar.gz
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.
Potentially problematic release.
This version of golf-mcp might be problematic. Click here for more details.
- golf_mcp-0.1.2/PKG-INFO +180 -0
- golf_mcp-0.1.2/README.md +143 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/pyproject.toml +1 -1
- golf_mcp-0.1.2/src/golf/__init__.py +1 -0
- golf_mcp-0.1.2/src/golf/examples/basic/README.md +61 -0
- golf_mcp-0.1.2/src/golf_mcp.egg-info/PKG-INFO +180 -0
- golf_mcp-0.1.1/PKG-INFO +0 -78
- golf_mcp-0.1.1/README.md +0 -41
- golf_mcp-0.1.1/src/golf/__init__.py +0 -1
- golf_mcp-0.1.1/src/golf/examples/basic/README.md +0 -117
- golf_mcp-0.1.1/src/golf_mcp.egg-info/PKG-INFO +0 -78
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/docs.md +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/fast-mcp.md +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/fastmcp-example-1.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/fastmcp-example-2.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/mcp.md +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/oauth-implementation.md +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/.docs/oauth.md +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/LICENSE +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/MANIFEST.in +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/setup.cfg +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/auth/__init__.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/auth/helpers.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/auth/oauth.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/auth/provider.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/cli/__init__.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/cli/main.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/commands/__init__.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/commands/build.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/commands/init.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/commands/run.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/__init__.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/builder.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/builder_auth.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/builder_telemetry.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/config.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/parser.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/core/transformer.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/__init__.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/.env +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/.env.example +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/golf.json +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/pre_build.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/prompts/welcome.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/resources/current_time.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/resources/info.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/resources/weather/common.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/resources/weather/current.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/resources/weather/forecast.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/tools/github_user.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/tools/hello.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/tools/payments/charge.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/tools/payments/common.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf/examples/basic/tools/payments/refund.py +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf_mcp.egg-info/SOURCES.txt +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf_mcp.egg-info/dependency_links.txt +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf_mcp.egg-info/entry_points.txt +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf_mcp.egg-info/requires.txt +0 -0
- {golf_mcp-0.1.1 → golf_mcp-0.1.2}/src/golf_mcp.egg-info/top_level.txt +0 -0
golf_mcp-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: golf-mcp
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Framework for building MCP servers
|
|
5
|
+
Author-email: Antoni Gmitruk <antoni@golf.dev>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://golf.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/golf-mcp/golf
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: typer>=0.15.4
|
|
23
|
+
Requires-Dist: rich>=14.0.0
|
|
24
|
+
Requires-Dist: fastmcp>=2.0.0
|
|
25
|
+
Requires-Dist: pydantic>=2.11.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.1.0
|
|
27
|
+
Requires-Dist: black>=24.10.0
|
|
28
|
+
Requires-Dist: pyjwt>=2.0.0
|
|
29
|
+
Requires-Dist: httpx>=0.28.1
|
|
30
|
+
Provides-Extra: telemetry
|
|
31
|
+
Requires-Dist: opentelemetry-api>=1.33.1; extra == "telemetry"
|
|
32
|
+
Requires-Dist: opentelemetry-sdk>=1.33.1; extra == "telemetry"
|
|
33
|
+
Requires-Dist: opentelemetry-instrumentation-asgi>=0.40b0; extra == "telemetry"
|
|
34
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=0.40b0; extra == "telemetry"
|
|
35
|
+
Requires-Dist: wrapt>=1.17.0; extra == "telemetry"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
<img src="./golf-banner.png" alt="Golf Banner">
|
|
40
|
+
|
|
41
|
+
<h1>Golf</h1>
|
|
42
|
+
|
|
43
|
+
<p><strong>Easiest framework for building MCP servers.</strong></p>
|
|
44
|
+
|
|
45
|
+
<p>
|
|
46
|
+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
|
|
47
|
+
<a href="https://github.com/golf-mcp/golf/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"></a>
|
|
48
|
+
<a href="https://github.com/golf-mcp/golf/issues"><img src="https://img.shields.io/badge/support-contact%20author-purple.svg" alt="Support"></a>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<p><a href="https://docs.golf.dev">Docs</a></p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
## Overview
|
|
55
|
+
|
|
56
|
+
Golf is a **framework** designed to streamline the creation of MCP server applications. It allows developers to define server's capabilities—*tools*, *prompts*, and *resources*—as simple Python files within a conventional directory structure. Golf then automatically discovers, parses, and compiles these components into a runnable FastMCP server, minimizing boilerplate and accelerating development.
|
|
57
|
+
|
|
58
|
+
With Golf, you can focus on implementing your agent's logic rather than wrestling with server setup and integration complexities. It's built for developers who want a quick, organized way to build powerful MCP servers.
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
Get your Golf project up and running in a few simple steps:
|
|
63
|
+
|
|
64
|
+
### 1. Install Golf
|
|
65
|
+
|
|
66
|
+
Ensure you have Python (3.10+ recommended) installed. Then, install Golf using pip:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install golf-mcp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 2. Initialize Your Project
|
|
73
|
+
|
|
74
|
+
Use the Golf CLI to scaffold a new project:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
golf init your-project-name
|
|
78
|
+
```
|
|
79
|
+
This command creates a new directory (`your-project-name`) with a basic project structure, including example tools, resources, and a `golf.json` configuration file.
|
|
80
|
+
|
|
81
|
+
### 3. Run the Development Server
|
|
82
|
+
|
|
83
|
+
Navigate into your new project directory and start the development server:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cd your-project-name
|
|
87
|
+
golf build dev
|
|
88
|
+
golf run
|
|
89
|
+
```
|
|
90
|
+
This will start the FastMCP server, typically on `http://127.0.0.1:3000` (configurable in `golf.json`). The `dev` command includes hot reloading, so changes to your component files will automatically restart the server.
|
|
91
|
+
|
|
92
|
+
That's it! Your Golf server is running and ready for integration.
|
|
93
|
+
|
|
94
|
+
## Basic Project Structure
|
|
95
|
+
|
|
96
|
+
A Golf project initialized with `golf init` will have a structure similar to this:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
<your-project-name>/
|
|
100
|
+
│
|
|
101
|
+
├─ golf.json # Main project configuration
|
|
102
|
+
│
|
|
103
|
+
├─ tools/ # Directory for tool implementations
|
|
104
|
+
│ └─ hello.py # Example tool
|
|
105
|
+
│
|
|
106
|
+
├─ resources/ # Directory for resource implementations
|
|
107
|
+
│ └─ info.py # Example resource
|
|
108
|
+
│
|
|
109
|
+
├─ prompts/ # Directory for prompt templates
|
|
110
|
+
│ └─ welcome.py # Example prompt
|
|
111
|
+
│
|
|
112
|
+
├─ .env # Environment variables (e.g., API keys, server port)
|
|
113
|
+
└─ pre_build.py # (Optional) Script for pre-build hooks (e.g., auth setup)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- **`golf.json`**: Configures server name, port, transport, telemetry, and other build settings.
|
|
117
|
+
- **`tools/`**, **`resources/`**, **`prompts/`**: Contain your Python files, each defining a single component. These directories can also contain nested subdirectories to further organize your components (e.g., `tools/payments/charge.py`). The module docstring of each file serves as the component's description.
|
|
118
|
+
- Component IDs are automatically derived from their file path. For example, `tools/hello.py` becomes `hello`, and a nested file like `tools/payments/submit.py` would become `submit-payments` (filename, followed by reversed parent directories under the main category, joined by hyphens).
|
|
119
|
+
- **`common.py`** (not shown, but can be placed in subdirectories like `tools/payments/common.py`): Used to share code (clients, models, etc.) among components in the same subdirectory.
|
|
120
|
+
|
|
121
|
+
## Example: Defining a Tool
|
|
122
|
+
|
|
123
|
+
Creating a new tool is as simple as adding a Python file to the `tools/` directory. The example `tools/hello.py` in the boilerplate looks like this:
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
# tools/hello.py
|
|
127
|
+
"""Hello World tool {{project_name}}."""
|
|
128
|
+
|
|
129
|
+
from pydantic import BaseModel
|
|
130
|
+
|
|
131
|
+
class Output(BaseModel):
|
|
132
|
+
"""Response from the hello tool."""
|
|
133
|
+
message: str
|
|
134
|
+
|
|
135
|
+
async def hello(
|
|
136
|
+
name: str = "World",
|
|
137
|
+
greeting: str = "Hello"
|
|
138
|
+
) -> Output:
|
|
139
|
+
"""Say hello to the given name.
|
|
140
|
+
|
|
141
|
+
This is a simple example tool that demonstrates the basic structure
|
|
142
|
+
of a tool implementation in Golf.
|
|
143
|
+
"""
|
|
144
|
+
print(f"{greeting} {name}...")
|
|
145
|
+
return Output(message=f"{greeting}, {name}!")
|
|
146
|
+
|
|
147
|
+
# Designate the entry point function
|
|
148
|
+
export = hello
|
|
149
|
+
```
|
|
150
|
+
Golf will automatically discover this file. The module docstring `"""Hello World tool {{project_name}}."""` is used as the tool's description. It infers parameters from the `hello` function's signature and uses the `Output` Pydantic model for the output schema. The tool will be registered with the ID `hello`.
|
|
151
|
+
|
|
152
|
+
## Configuration (`golf.json`)
|
|
153
|
+
|
|
154
|
+
Key aspects of your Golf server are configured in `golf.json`. The boilerplate provides a starting point like this:
|
|
155
|
+
|
|
156
|
+
```jsonc
|
|
157
|
+
{
|
|
158
|
+
"name": "{{project_name}}", // Will be replaced with your project name
|
|
159
|
+
"description": "A Golf project", // A default description
|
|
160
|
+
"host": "127.0.0.1", // Server host address
|
|
161
|
+
"port": 3000, // Server port
|
|
162
|
+
"transport": "sse", // 'sse', 'streamable-http', or 'stdio'
|
|
163
|
+
"opentelemetry_enabled": false, // OpenTelemetry disabled by default - we're working on this as a feature
|
|
164
|
+
"opentelemetry_default_exporter": "console"
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
## Roadmap
|
|
168
|
+
|
|
169
|
+
We are actively developing Golf. Here's what's on our current roadmap:
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
For more information, please visit our official documentation:
|
|
175
|
+
|
|
176
|
+
[https://docs.golf.dev](https://docs.golf.dev)
|
|
177
|
+
|
|
178
|
+
<div align="center">
|
|
179
|
+
Made with ❤️ in Warsaw, Poland and SF
|
|
180
|
+
</div>
|
golf_mcp-0.1.2/README.md
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./golf-banner.png" alt="Golf Banner">
|
|
3
|
+
|
|
4
|
+
<h1>Golf</h1>
|
|
5
|
+
|
|
6
|
+
<p><strong>Easiest framework for building MCP servers.</strong></p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
|
|
10
|
+
<a href="https://github.com/golf-mcp/golf/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"></a>
|
|
11
|
+
<a href="https://github.com/golf-mcp/golf/issues"><img src="https://img.shields.io/badge/support-contact%20author-purple.svg" alt="Support"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p><a href="https://docs.golf.dev">Docs</a></p>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
Golf is a **framework** designed to streamline the creation of MCP server applications. It allows developers to define server's capabilities—*tools*, *prompts*, and *resources*—as simple Python files within a conventional directory structure. Golf then automatically discovers, parses, and compiles these components into a runnable FastMCP server, minimizing boilerplate and accelerating development.
|
|
20
|
+
|
|
21
|
+
With Golf, you can focus on implementing your agent's logic rather than wrestling with server setup and integration complexities. It's built for developers who want a quick, organized way to build powerful MCP servers.
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
Get your Golf project up and running in a few simple steps:
|
|
26
|
+
|
|
27
|
+
### 1. Install Golf
|
|
28
|
+
|
|
29
|
+
Ensure you have Python (3.10+ recommended) installed. Then, install Golf using pip:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install golf-mcp
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. Initialize Your Project
|
|
36
|
+
|
|
37
|
+
Use the Golf CLI to scaffold a new project:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
golf init your-project-name
|
|
41
|
+
```
|
|
42
|
+
This command creates a new directory (`your-project-name`) with a basic project structure, including example tools, resources, and a `golf.json` configuration file.
|
|
43
|
+
|
|
44
|
+
### 3. Run the Development Server
|
|
45
|
+
|
|
46
|
+
Navigate into your new project directory and start the development server:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd your-project-name
|
|
50
|
+
golf build dev
|
|
51
|
+
golf run
|
|
52
|
+
```
|
|
53
|
+
This will start the FastMCP server, typically on `http://127.0.0.1:3000` (configurable in `golf.json`). The `dev` command includes hot reloading, so changes to your component files will automatically restart the server.
|
|
54
|
+
|
|
55
|
+
That's it! Your Golf server is running and ready for integration.
|
|
56
|
+
|
|
57
|
+
## Basic Project Structure
|
|
58
|
+
|
|
59
|
+
A Golf project initialized with `golf init` will have a structure similar to this:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
<your-project-name>/
|
|
63
|
+
│
|
|
64
|
+
├─ golf.json # Main project configuration
|
|
65
|
+
│
|
|
66
|
+
├─ tools/ # Directory for tool implementations
|
|
67
|
+
│ └─ hello.py # Example tool
|
|
68
|
+
│
|
|
69
|
+
├─ resources/ # Directory for resource implementations
|
|
70
|
+
│ └─ info.py # Example resource
|
|
71
|
+
│
|
|
72
|
+
├─ prompts/ # Directory for prompt templates
|
|
73
|
+
│ └─ welcome.py # Example prompt
|
|
74
|
+
│
|
|
75
|
+
├─ .env # Environment variables (e.g., API keys, server port)
|
|
76
|
+
└─ pre_build.py # (Optional) Script for pre-build hooks (e.g., auth setup)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- **`golf.json`**: Configures server name, port, transport, telemetry, and other build settings.
|
|
80
|
+
- **`tools/`**, **`resources/`**, **`prompts/`**: Contain your Python files, each defining a single component. These directories can also contain nested subdirectories to further organize your components (e.g., `tools/payments/charge.py`). The module docstring of each file serves as the component's description.
|
|
81
|
+
- Component IDs are automatically derived from their file path. For example, `tools/hello.py` becomes `hello`, and a nested file like `tools/payments/submit.py` would become `submit-payments` (filename, followed by reversed parent directories under the main category, joined by hyphens).
|
|
82
|
+
- **`common.py`** (not shown, but can be placed in subdirectories like `tools/payments/common.py`): Used to share code (clients, models, etc.) among components in the same subdirectory.
|
|
83
|
+
|
|
84
|
+
## Example: Defining a Tool
|
|
85
|
+
|
|
86
|
+
Creating a new tool is as simple as adding a Python file to the `tools/` directory. The example `tools/hello.py` in the boilerplate looks like this:
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# tools/hello.py
|
|
90
|
+
"""Hello World tool {{project_name}}."""
|
|
91
|
+
|
|
92
|
+
from pydantic import BaseModel
|
|
93
|
+
|
|
94
|
+
class Output(BaseModel):
|
|
95
|
+
"""Response from the hello tool."""
|
|
96
|
+
message: str
|
|
97
|
+
|
|
98
|
+
async def hello(
|
|
99
|
+
name: str = "World",
|
|
100
|
+
greeting: str = "Hello"
|
|
101
|
+
) -> Output:
|
|
102
|
+
"""Say hello to the given name.
|
|
103
|
+
|
|
104
|
+
This is a simple example tool that demonstrates the basic structure
|
|
105
|
+
of a tool implementation in Golf.
|
|
106
|
+
"""
|
|
107
|
+
print(f"{greeting} {name}...")
|
|
108
|
+
return Output(message=f"{greeting}, {name}!")
|
|
109
|
+
|
|
110
|
+
# Designate the entry point function
|
|
111
|
+
export = hello
|
|
112
|
+
```
|
|
113
|
+
Golf will automatically discover this file. The module docstring `"""Hello World tool {{project_name}}."""` is used as the tool's description. It infers parameters from the `hello` function's signature and uses the `Output` Pydantic model for the output schema. The tool will be registered with the ID `hello`.
|
|
114
|
+
|
|
115
|
+
## Configuration (`golf.json`)
|
|
116
|
+
|
|
117
|
+
Key aspects of your Golf server are configured in `golf.json`. The boilerplate provides a starting point like this:
|
|
118
|
+
|
|
119
|
+
```jsonc
|
|
120
|
+
{
|
|
121
|
+
"name": "{{project_name}}", // Will be replaced with your project name
|
|
122
|
+
"description": "A Golf project", // A default description
|
|
123
|
+
"host": "127.0.0.1", // Server host address
|
|
124
|
+
"port": 3000, // Server port
|
|
125
|
+
"transport": "sse", // 'sse', 'streamable-http', or 'stdio'
|
|
126
|
+
"opentelemetry_enabled": false, // OpenTelemetry disabled by default - we're working on this as a feature
|
|
127
|
+
"opentelemetry_default_exporter": "console"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
## Roadmap
|
|
131
|
+
|
|
132
|
+
We are actively developing Golf. Here's what's on our current roadmap:
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
## Documentation
|
|
136
|
+
|
|
137
|
+
For more information, please visit our official documentation:
|
|
138
|
+
|
|
139
|
+
[https://docs.golf.dev](https://docs.golf.dev)
|
|
140
|
+
|
|
141
|
+
<div align="center">
|
|
142
|
+
Made with ❤️ in Warsaw, Poland and SF
|
|
143
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2"
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# GolfMCP Project Boilerplate
|
|
2
|
+
|
|
3
|
+
This directory serves as a starting template for new GolfMCP projects. Initialize a project using the `golf init <your-project-name>` command.
|
|
4
|
+
## About GolfMCP
|
|
5
|
+
|
|
6
|
+
GolfMCP is a Python framework designed to build MCP servers with minimal boilerplate. It allows you to define tools, resources, and prompts as simple Python files. These components are then automatically discovered and compiled into a runnable [FastMCP](https://github.com/fastmcp/fastmcp) server.
|
|
7
|
+
|
|
8
|
+
## Getting Started (After `golf init`)
|
|
9
|
+
|
|
10
|
+
Once you've initialized your new project from this boilerplate:
|
|
11
|
+
|
|
12
|
+
1. **Navigate to your project directory:**
|
|
13
|
+
```bash
|
|
14
|
+
cd your-project-name
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. **Start the development server:**
|
|
18
|
+
```bash
|
|
19
|
+
golf build dev # For a development build
|
|
20
|
+
# or
|
|
21
|
+
golf build prod # For a production build
|
|
22
|
+
|
|
23
|
+
golf run
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Project Structure
|
|
27
|
+
|
|
28
|
+
Your initialized GolfMCP project will typically have the following structure:
|
|
29
|
+
|
|
30
|
+
- `tools/`: Directory for your tool implementations (Python files defining functions an LLM can call).
|
|
31
|
+
- `resources/`: Directory for your resource implementations (Python files defining data an LLM can read).
|
|
32
|
+
- `prompts/`: Directory for your prompt templates (Python files defining reusable conversation structures).
|
|
33
|
+
- `golf.json`: The main configuration file for your project, including settings like the server name, port, and transport.
|
|
34
|
+
- `pre_build.py`: (Optional) A Python script that can be used to run custom logic before the build process begins, such as configuring authentication.
|
|
35
|
+
- `.env`: File to store environment-specific variables (e.g., API keys). This is created during `golf init`.
|
|
36
|
+
|
|
37
|
+
## Adding New Components
|
|
38
|
+
|
|
39
|
+
To add new functionalities:
|
|
40
|
+
|
|
41
|
+
- **Tools**: Create a new `.py` file in the `tools/` directory.
|
|
42
|
+
- **Resources**: Create a new `.py` file in the `resources/` directory.
|
|
43
|
+
- **Prompts**: Create a new `.py` file in the `prompts/` directory.
|
|
44
|
+
|
|
45
|
+
Each Python file should generally define a single component. A module-level docstring in the file will be used as the description for the component. See the example files (e.g., `tools/hello.py`, `resources/info.py`) provided in this boilerplate for reference.
|
|
46
|
+
|
|
47
|
+
For shared functionality within a component subdirectory (e.g., `tools/payments/common.py`), you can use a `common.py` file.
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
For comprehensive details on the GolfMCP framework, including component specifications, advanced configurations, CLI commands, and more, please refer to the official documentation:
|
|
52
|
+
|
|
53
|
+
[https://docs.golf.dev](https://docs.golf.dev)
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
Happy Building!
|
|
58
|
+
|
|
59
|
+
<div align="center">
|
|
60
|
+
Made with ❤️ in San Francisco
|
|
61
|
+
</div>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: golf-mcp
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Framework for building MCP servers
|
|
5
|
+
Author-email: Antoni Gmitruk <antoni@golf.dev>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://golf.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/golf-mcp/golf
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Requires-Python: >=3.8
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
License-File: LICENSE
|
|
22
|
+
Requires-Dist: typer>=0.15.4
|
|
23
|
+
Requires-Dist: rich>=14.0.0
|
|
24
|
+
Requires-Dist: fastmcp>=2.0.0
|
|
25
|
+
Requires-Dist: pydantic>=2.11.0
|
|
26
|
+
Requires-Dist: python-dotenv>=1.1.0
|
|
27
|
+
Requires-Dist: black>=24.10.0
|
|
28
|
+
Requires-Dist: pyjwt>=2.0.0
|
|
29
|
+
Requires-Dist: httpx>=0.28.1
|
|
30
|
+
Provides-Extra: telemetry
|
|
31
|
+
Requires-Dist: opentelemetry-api>=1.33.1; extra == "telemetry"
|
|
32
|
+
Requires-Dist: opentelemetry-sdk>=1.33.1; extra == "telemetry"
|
|
33
|
+
Requires-Dist: opentelemetry-instrumentation-asgi>=0.40b0; extra == "telemetry"
|
|
34
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=0.40b0; extra == "telemetry"
|
|
35
|
+
Requires-Dist: wrapt>=1.17.0; extra == "telemetry"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
<img src="./golf-banner.png" alt="Golf Banner">
|
|
40
|
+
|
|
41
|
+
<h1>Golf</h1>
|
|
42
|
+
|
|
43
|
+
<p><strong>Easiest framework for building MCP servers.</strong></p>
|
|
44
|
+
|
|
45
|
+
<p>
|
|
46
|
+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License"></a>
|
|
47
|
+
<a href="https://github.com/golf-mcp/golf/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs"></a>
|
|
48
|
+
<a href="https://github.com/golf-mcp/golf/issues"><img src="https://img.shields.io/badge/support-contact%20author-purple.svg" alt="Support"></a>
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<p><a href="https://docs.golf.dev">Docs</a></p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
## Overview
|
|
55
|
+
|
|
56
|
+
Golf is a **framework** designed to streamline the creation of MCP server applications. It allows developers to define server's capabilities—*tools*, *prompts*, and *resources*—as simple Python files within a conventional directory structure. Golf then automatically discovers, parses, and compiles these components into a runnable FastMCP server, minimizing boilerplate and accelerating development.
|
|
57
|
+
|
|
58
|
+
With Golf, you can focus on implementing your agent's logic rather than wrestling with server setup and integration complexities. It's built for developers who want a quick, organized way to build powerful MCP servers.
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
Get your Golf project up and running in a few simple steps:
|
|
63
|
+
|
|
64
|
+
### 1. Install Golf
|
|
65
|
+
|
|
66
|
+
Ensure you have Python (3.10+ recommended) installed. Then, install Golf using pip:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pip install golf-mcp
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 2. Initialize Your Project
|
|
73
|
+
|
|
74
|
+
Use the Golf CLI to scaffold a new project:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
golf init your-project-name
|
|
78
|
+
```
|
|
79
|
+
This command creates a new directory (`your-project-name`) with a basic project structure, including example tools, resources, and a `golf.json` configuration file.
|
|
80
|
+
|
|
81
|
+
### 3. Run the Development Server
|
|
82
|
+
|
|
83
|
+
Navigate into your new project directory and start the development server:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cd your-project-name
|
|
87
|
+
golf build dev
|
|
88
|
+
golf run
|
|
89
|
+
```
|
|
90
|
+
This will start the FastMCP server, typically on `http://127.0.0.1:3000` (configurable in `golf.json`). The `dev` command includes hot reloading, so changes to your component files will automatically restart the server.
|
|
91
|
+
|
|
92
|
+
That's it! Your Golf server is running and ready for integration.
|
|
93
|
+
|
|
94
|
+
## Basic Project Structure
|
|
95
|
+
|
|
96
|
+
A Golf project initialized with `golf init` will have a structure similar to this:
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
<your-project-name>/
|
|
100
|
+
│
|
|
101
|
+
├─ golf.json # Main project configuration
|
|
102
|
+
│
|
|
103
|
+
├─ tools/ # Directory for tool implementations
|
|
104
|
+
│ └─ hello.py # Example tool
|
|
105
|
+
│
|
|
106
|
+
├─ resources/ # Directory for resource implementations
|
|
107
|
+
│ └─ info.py # Example resource
|
|
108
|
+
│
|
|
109
|
+
├─ prompts/ # Directory for prompt templates
|
|
110
|
+
│ └─ welcome.py # Example prompt
|
|
111
|
+
│
|
|
112
|
+
├─ .env # Environment variables (e.g., API keys, server port)
|
|
113
|
+
└─ pre_build.py # (Optional) Script for pre-build hooks (e.g., auth setup)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- **`golf.json`**: Configures server name, port, transport, telemetry, and other build settings.
|
|
117
|
+
- **`tools/`**, **`resources/`**, **`prompts/`**: Contain your Python files, each defining a single component. These directories can also contain nested subdirectories to further organize your components (e.g., `tools/payments/charge.py`). The module docstring of each file serves as the component's description.
|
|
118
|
+
- Component IDs are automatically derived from their file path. For example, `tools/hello.py` becomes `hello`, and a nested file like `tools/payments/submit.py` would become `submit-payments` (filename, followed by reversed parent directories under the main category, joined by hyphens).
|
|
119
|
+
- **`common.py`** (not shown, but can be placed in subdirectories like `tools/payments/common.py`): Used to share code (clients, models, etc.) among components in the same subdirectory.
|
|
120
|
+
|
|
121
|
+
## Example: Defining a Tool
|
|
122
|
+
|
|
123
|
+
Creating a new tool is as simple as adding a Python file to the `tools/` directory. The example `tools/hello.py` in the boilerplate looks like this:
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
# tools/hello.py
|
|
127
|
+
"""Hello World tool {{project_name}}."""
|
|
128
|
+
|
|
129
|
+
from pydantic import BaseModel
|
|
130
|
+
|
|
131
|
+
class Output(BaseModel):
|
|
132
|
+
"""Response from the hello tool."""
|
|
133
|
+
message: str
|
|
134
|
+
|
|
135
|
+
async def hello(
|
|
136
|
+
name: str = "World",
|
|
137
|
+
greeting: str = "Hello"
|
|
138
|
+
) -> Output:
|
|
139
|
+
"""Say hello to the given name.
|
|
140
|
+
|
|
141
|
+
This is a simple example tool that demonstrates the basic structure
|
|
142
|
+
of a tool implementation in Golf.
|
|
143
|
+
"""
|
|
144
|
+
print(f"{greeting} {name}...")
|
|
145
|
+
return Output(message=f"{greeting}, {name}!")
|
|
146
|
+
|
|
147
|
+
# Designate the entry point function
|
|
148
|
+
export = hello
|
|
149
|
+
```
|
|
150
|
+
Golf will automatically discover this file. The module docstring `"""Hello World tool {{project_name}}."""` is used as the tool's description. It infers parameters from the `hello` function's signature and uses the `Output` Pydantic model for the output schema. The tool will be registered with the ID `hello`.
|
|
151
|
+
|
|
152
|
+
## Configuration (`golf.json`)
|
|
153
|
+
|
|
154
|
+
Key aspects of your Golf server are configured in `golf.json`. The boilerplate provides a starting point like this:
|
|
155
|
+
|
|
156
|
+
```jsonc
|
|
157
|
+
{
|
|
158
|
+
"name": "{{project_name}}", // Will be replaced with your project name
|
|
159
|
+
"description": "A Golf project", // A default description
|
|
160
|
+
"host": "127.0.0.1", // Server host address
|
|
161
|
+
"port": 3000, // Server port
|
|
162
|
+
"transport": "sse", // 'sse', 'streamable-http', or 'stdio'
|
|
163
|
+
"opentelemetry_enabled": false, // OpenTelemetry disabled by default - we're working on this as a feature
|
|
164
|
+
"opentelemetry_default_exporter": "console"
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
## Roadmap
|
|
168
|
+
|
|
169
|
+
We are actively developing Golf. Here's what's on our current roadmap:
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
For more information, please visit our official documentation:
|
|
175
|
+
|
|
176
|
+
[https://docs.golf.dev](https://docs.golf.dev)
|
|
177
|
+
|
|
178
|
+
<div align="center">
|
|
179
|
+
Made with ❤️ in Warsaw, Poland and SF
|
|
180
|
+
</div>
|
golf_mcp-0.1.1/PKG-INFO
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: golf-mcp
|
|
3
|
-
Version: 0.1.1
|
|
4
|
-
Summary: Framework for building MCP servers
|
|
5
|
-
Author-email: Antoni Gmitruk <antoni@golf.dev>
|
|
6
|
-
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Homepage, https://golf.dev
|
|
8
|
-
Project-URL: Repository, https://github.com/golf-mcp/golf
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Requires-Python: >=3.8
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: typer>=0.15.4
|
|
23
|
-
Requires-Dist: rich>=14.0.0
|
|
24
|
-
Requires-Dist: fastmcp>=2.0.0
|
|
25
|
-
Requires-Dist: pydantic>=2.11.0
|
|
26
|
-
Requires-Dist: python-dotenv>=1.1.0
|
|
27
|
-
Requires-Dist: black>=24.10.0
|
|
28
|
-
Requires-Dist: pyjwt>=2.0.0
|
|
29
|
-
Requires-Dist: httpx>=0.28.1
|
|
30
|
-
Provides-Extra: telemetry
|
|
31
|
-
Requires-Dist: opentelemetry-api>=1.33.1; extra == "telemetry"
|
|
32
|
-
Requires-Dist: opentelemetry-sdk>=1.33.1; extra == "telemetry"
|
|
33
|
-
Requires-Dist: opentelemetry-instrumentation-asgi>=0.40b0; extra == "telemetry"
|
|
34
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=0.40b0; extra == "telemetry"
|
|
35
|
-
Requires-Dist: wrapt>=1.17.0; extra == "telemetry"
|
|
36
|
-
Dynamic: license-file
|
|
37
|
-
|
|
38
|
-
# GolfMCP
|
|
39
|
-
|
|
40
|
-
A Pythonic framework for building Model Context Protocol (MCP) servers with zero boilerplate.
|
|
41
|
-
|
|
42
|
-
## Features
|
|
43
|
-
|
|
44
|
-
* 🚀 **Zero-to-live in under 90 seconds**: Quick setup and deployment
|
|
45
|
-
* 💡 **Convention over configuration**: Minimal boilerplate
|
|
46
|
-
* 🔄 **Fast feedback**: Hot-reload during development (≤ 500 ms)
|
|
47
|
-
* 📂 **Nested folder support**: Organize your tools, resources, and prompts
|
|
48
|
-
* 🔌 **Pluggable auth & deploy**: Built-in providers for OAuth, Vercel, Fly.io, etc.
|
|
49
|
-
* 🛠️ **Delegates protocol compliance to FastMCP**: Focus on your logic, not the wire format
|
|
50
|
-
|
|
51
|
-
## Installation
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
pip install golfmcp
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Quick Start
|
|
58
|
-
|
|
59
|
-
Initialize a new project:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
golf init my-mcp-project
|
|
63
|
-
cd my-mcp-project
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Start the development server with hot-reload:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
golf dev
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Documentation
|
|
73
|
-
|
|
74
|
-
For detailed documentation, visit [docs](https://golfmcp.docs.example.com/).
|
|
75
|
-
|
|
76
|
-
## License
|
|
77
|
-
|
|
78
|
-
MIT License
|
golf_mcp-0.1.1/README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# GolfMCP
|
|
2
|
-
|
|
3
|
-
A Pythonic framework for building Model Context Protocol (MCP) servers with zero boilerplate.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
* 🚀 **Zero-to-live in under 90 seconds**: Quick setup and deployment
|
|
8
|
-
* 💡 **Convention over configuration**: Minimal boilerplate
|
|
9
|
-
* 🔄 **Fast feedback**: Hot-reload during development (≤ 500 ms)
|
|
10
|
-
* 📂 **Nested folder support**: Organize your tools, resources, and prompts
|
|
11
|
-
* 🔌 **Pluggable auth & deploy**: Built-in providers for OAuth, Vercel, Fly.io, etc.
|
|
12
|
-
* 🛠️ **Delegates protocol compliance to FastMCP**: Focus on your logic, not the wire format
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pip install golfmcp
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Quick Start
|
|
21
|
-
|
|
22
|
-
Initialize a new project:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
golf init my-mcp-project
|
|
26
|
-
cd my-mcp-project
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Start the development server with hot-reload:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
golf dev
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Documentation
|
|
36
|
-
|
|
37
|
-
For detailed documentation, visit [docs](https://golfmcp.docs.example.com/).
|
|
38
|
-
|
|
39
|
-
## License
|
|
40
|
-
|
|
41
|
-
MIT License
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.1"
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# {{project_name}}
|
|
2
|
-
|
|
3
|
-
A GolfMCP project that provides MCP-compatible tools, resources, and prompts.
|
|
4
|
-
|
|
5
|
-
## Getting Started
|
|
6
|
-
|
|
7
|
-
This project is built with [GolfMCP](https://github.com/yourusername/golfmcp), a Python framework for building MCP servers with zero boilerplate.
|
|
8
|
-
|
|
9
|
-
To start the development server with hot reload:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
golf dev
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This will watch for file changes and automatically reload the server.
|
|
16
|
-
|
|
17
|
-
## Project Structure
|
|
18
|
-
|
|
19
|
-
- `tools/` - Tool implementations (functions an LLM can call)
|
|
20
|
-
- `resources/` - Resource implementations (data an LLM can read)
|
|
21
|
-
- `prompts/` - Prompt templates (conversations an LLM can use)
|
|
22
|
-
- `golf.json` - Configuration file with settings like telemetry and transport
|
|
23
|
-
|
|
24
|
-
## Adding New Components
|
|
25
|
-
|
|
26
|
-
### Tools
|
|
27
|
-
|
|
28
|
-
To add a new tool, create a Python file in the `tools/` directory:
|
|
29
|
-
|
|
30
|
-
```python
|
|
31
|
-
# tools/my_tool.py
|
|
32
|
-
from pydantic import BaseModel
|
|
33
|
-
from fastmcp import Context
|
|
34
|
-
|
|
35
|
-
class Input(BaseModel):
|
|
36
|
-
param1: str
|
|
37
|
-
param2: int = 42
|
|
38
|
-
|
|
39
|
-
class Output(BaseModel):
|
|
40
|
-
result: str
|
|
41
|
-
|
|
42
|
-
async def run(input: Input, ctx: Context) -> Output:
|
|
43
|
-
"""Description of what my tool does."""
|
|
44
|
-
await ctx.info(f"Processing {input.param1}...")
|
|
45
|
-
return MyOutput(result=f"Processed {input.param1} with {input.param2}")
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Resources
|
|
49
|
-
|
|
50
|
-
To add a new resource, create a Python file in the `resources/` directory:
|
|
51
|
-
|
|
52
|
-
```python
|
|
53
|
-
# resources/my_data.py
|
|
54
|
-
resource_uri = "data://my-data"
|
|
55
|
-
|
|
56
|
-
async def run() -> dict:
|
|
57
|
-
"""Description of the resource."""
|
|
58
|
-
return {
|
|
59
|
-
"title": "My Data",
|
|
60
|
-
"content": "Some valuable information"
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Sharing Functionality with common.py
|
|
65
|
-
|
|
66
|
-
For directories with multiple related components (like `tools/payments/` or `resources/weather/`),
|
|
67
|
-
use a `common.py` file to share functionality:
|
|
68
|
-
|
|
69
|
-
```python
|
|
70
|
-
# tools/payments/common.py
|
|
71
|
-
class PaymentClient:
|
|
72
|
-
"""Shared payment client implementation."""
|
|
73
|
-
# Implementation details...
|
|
74
|
-
|
|
75
|
-
# Create a shared client instance
|
|
76
|
-
payment_client = PaymentClient()
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Then import and use the shared functionality in your components:
|
|
80
|
-
|
|
81
|
-
```python
|
|
82
|
-
# tools/payments/charge.py
|
|
83
|
-
from .common import payment_client
|
|
84
|
-
|
|
85
|
-
async def run(input):
|
|
86
|
-
result = await payment_client.create_charge(...)
|
|
87
|
-
# Rest of implementation...
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
This pattern helps organize shared code and makes it easier to build and maintain your project.
|
|
91
|
-
|
|
92
|
-
## Telemetry
|
|
93
|
-
|
|
94
|
-
This project includes OpenTelemetry integration for tracing server requests:
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
// golf.json
|
|
98
|
-
{
|
|
99
|
-
"telemetry": true,
|
|
100
|
-
"telemetry_exporter": "console" // or "otlp_http"
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
You can configure it with environment variables:
|
|
105
|
-
- `OTEL_SERVICE_NAME`: Set service name (defaults to app name)
|
|
106
|
-
- `OTEL_TRACES_EXPORTER`: Exporter type ("console" or "otlp_http")
|
|
107
|
-
- `OTEL_EXPORTER_OTLP_ENDPOINT`: OTLP exporter endpoint URL
|
|
108
|
-
|
|
109
|
-
## Deployment
|
|
110
|
-
|
|
111
|
-
To build the project for deployment:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
golf build
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
This creates a standalone FastMCP application in the `dist/` directory.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: golf-mcp
|
|
3
|
-
Version: 0.1.1
|
|
4
|
-
Summary: Framework for building MCP servers
|
|
5
|
-
Author-email: Antoni Gmitruk <antoni@golf.dev>
|
|
6
|
-
License-Expression: Apache-2.0
|
|
7
|
-
Project-URL: Homepage, https://golf.dev
|
|
8
|
-
Project-URL: Repository, https://github.com/golf-mcp/golf
|
|
9
|
-
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
Requires-Python: >=3.8
|
|
20
|
-
Description-Content-Type: text/markdown
|
|
21
|
-
License-File: LICENSE
|
|
22
|
-
Requires-Dist: typer>=0.15.4
|
|
23
|
-
Requires-Dist: rich>=14.0.0
|
|
24
|
-
Requires-Dist: fastmcp>=2.0.0
|
|
25
|
-
Requires-Dist: pydantic>=2.11.0
|
|
26
|
-
Requires-Dist: python-dotenv>=1.1.0
|
|
27
|
-
Requires-Dist: black>=24.10.0
|
|
28
|
-
Requires-Dist: pyjwt>=2.0.0
|
|
29
|
-
Requires-Dist: httpx>=0.28.1
|
|
30
|
-
Provides-Extra: telemetry
|
|
31
|
-
Requires-Dist: opentelemetry-api>=1.33.1; extra == "telemetry"
|
|
32
|
-
Requires-Dist: opentelemetry-sdk>=1.33.1; extra == "telemetry"
|
|
33
|
-
Requires-Dist: opentelemetry-instrumentation-asgi>=0.40b0; extra == "telemetry"
|
|
34
|
-
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=0.40b0; extra == "telemetry"
|
|
35
|
-
Requires-Dist: wrapt>=1.17.0; extra == "telemetry"
|
|
36
|
-
Dynamic: license-file
|
|
37
|
-
|
|
38
|
-
# GolfMCP
|
|
39
|
-
|
|
40
|
-
A Pythonic framework for building Model Context Protocol (MCP) servers with zero boilerplate.
|
|
41
|
-
|
|
42
|
-
## Features
|
|
43
|
-
|
|
44
|
-
* 🚀 **Zero-to-live in under 90 seconds**: Quick setup and deployment
|
|
45
|
-
* 💡 **Convention over configuration**: Minimal boilerplate
|
|
46
|
-
* 🔄 **Fast feedback**: Hot-reload during development (≤ 500 ms)
|
|
47
|
-
* 📂 **Nested folder support**: Organize your tools, resources, and prompts
|
|
48
|
-
* 🔌 **Pluggable auth & deploy**: Built-in providers for OAuth, Vercel, Fly.io, etc.
|
|
49
|
-
* 🛠️ **Delegates protocol compliance to FastMCP**: Focus on your logic, not the wire format
|
|
50
|
-
|
|
51
|
-
## Installation
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
pip install golfmcp
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Quick Start
|
|
58
|
-
|
|
59
|
-
Initialize a new project:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
golf init my-mcp-project
|
|
63
|
-
cd my-mcp-project
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Start the development server with hot-reload:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
golf dev
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Documentation
|
|
73
|
-
|
|
74
|
-
For detailed documentation, visit [docs](https://golfmcp.docs.example.com/).
|
|
75
|
-
|
|
76
|
-
## License
|
|
77
|
-
|
|
78
|
-
MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|