docs: update custom extension project setup (#3793)

This commit is contained in:
dianed-square 2025-08-01 15:42:04 -07:00 committed by GitHub
parent 6b3018b77a
commit 7e7b19db9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 18 deletions

View file

@ -3,6 +3,8 @@ title: Building Custom Extensions
description: Create your own custom MCP Server to use as a Goose extension
---
import { PanelLeft } from 'lucide-react';
# Building Custom Extensions with Goose
@ -28,15 +30,12 @@ The first step is to create a new project using [uv][uv-docs]. We will name our
Run the following commands in your terminal to set up a basic structure for your MCP server:
```bash
uv init mcp-wiki
uv init --lib mcp-wiki
cd mcp-wiki
rm hello.py
mkdir -p src/mcp_wiki
touch src/mcp_wiki/server.py # Your MCP server code (tool, resources, prompts)
touch src/mcp_wiki/__init__.py # Primary CLI entry point
touch src/mcp_wiki/__main__.py # To enable running as a Python module
touch src/mcp_wiki/server.py
touch src/mcp_wiki/__main__.py
```
Your project directory structure should look like this:
@ -47,9 +46,10 @@ Your project directory structure should look like this:
├── pyproject.toml
├── src
│ └── mcp_wiki
│ ├── __init__.py
│ ├── __main__.py
│ └── server.py
│ ├── __init__.py # Primary CLI entry point
│ ├── __main__.py # To enable running as a Python module
│ ├── py.typed # Indicates the package supports type hints
│ └── server.py # Your MCP server code (tool, resources, prompts)
└── uv.lock
```
@ -247,24 +247,26 @@ build-backend = "hatchling.build"
To add your MCP server as an extension in Goose:
1. Go to `Settings > Extensions > Add`.
2. Set the `Type` to `StandardIO`.
3. Provide the ID, name, and description for your extension.
4. In the `Command` field, provide the absolute path to your executable. For example:
1. Click the <PanelLeft className="inline" size={16} /> button in the top-left to open the sidebar
2. Click `Extensions` in the sidebar
3. Set the `Type` to `STDIO`
4. Provide a name and description for your extension
5. In the `Command` field, provide the absolute path to your executable:
```plaintext
uv run /full/path/to/mcp-wiki/.venv/bin/mcp-wiki
```
Alternatively in Step 3, you can also publish your package to pypi. Once published, the server can be run directly using uvx. For example:
For example:
```plaintext
uv run /Users/smohammed/Development/mcp/mcp-wiki/.venv/bin/mcp-wiki
```
For the purposes on this guide, we'll run the local version. Alternatively, you can publish your package to PyPI. Once published, the server can be run directly using `uvx`. For example:
```
uvx mcp-wiki
```
For the purposes on this guide, we will show you how to run the local version. 
![Goose Settings for Adding Custom Extension](../assets/guides/custom-extension-settings.png)
---
## Step 6: Use Your Extension in Goose