Skip to main content
Let’s get you started with your first GolfMCP project from scratch.
1

Install GolfMCP

Install the Golf MCP framework using pip:
2

Initialize your project

Create a new GolfMCP project using the init command:
This will create a new directory named 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):
  1. Configure API key authentication in auth.py:
  2. Pass the token when connecting your MCP client
  3. Access the API key in your tools using:
4

Create your first tool

Let’s modify the example “hello” tool. Open tools/hello.py:
For more details on tool structure, parameters, and advanced patterns, see the Component Specification.
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: