1
Install GolfMCP
Install the Golf MCP framework using pip:
2
Initialize your project
Create a new GolfMCP project using the This will create a new directory named
init
command:my_awesome_server
with the following structure:golf.json
: Configures your server’s name, port, transport, etc. (see Configuration)auth.py
: Dedicated file for authentication setup (see Authentication)tools/
,resources/
,prompts/
: Directories where you’ll define your server’s capabilities (see Component Specification)
3
Set up authentication
The boilerplate example includes a tool that requires authentication. Golf v0.2.0 offers three authentication methods (for complete details, see Authentication):
- API key authentication
- Development authentication
- JWT authentication (Production)
-
Configure API key authentication in
auth.py
: - Pass the token when connecting your MCP client
-
Access the API key in your tools using:
4
Create your first tool
Let’s modify the example “hello” tool. Open For more details on tool structure, parameters, and advanced patterns, see the Component Specification.
tools/hello.py
:5
Build for development
Compile your project for development:This command builds the actual MCP server.
6
Run your server
Execute the built server:Congratulations! You’ve built and run your first GolfMCP server.
Next Steps
Now that you have a working MCP server, learn how to test it comprehensively:- Test your server - Use mcp-t to validate your implementation
- Set up automated testing - Create test suites for CI/CD
- Learn testing philosophy - Understand why traditional testing fails for MCP