docs: update custom extension project setup (#3793)
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
@@ -3,6 +3,8 @@ title: Building Custom Extensions
|
|||||||
description: Create your own custom MCP Server to use as a Goose extension
|
description: Create your own custom MCP Server to use as a Goose extension
|
||||||
---
|
---
|
||||||
|
|
||||||
|
import { PanelLeft } from 'lucide-react';
|
||||||
|
|
||||||
# Building Custom Extensions with Goose
|
# 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:
|
Run the following commands in your terminal to set up a basic structure for your MCP server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
uv init mcp-wiki
|
uv init --lib mcp-wiki
|
||||||
|
|
||||||
cd mcp-wiki
|
cd mcp-wiki
|
||||||
rm hello.py
|
|
||||||
|
|
||||||
mkdir -p src/mcp_wiki
|
mkdir -p src/mcp_wiki
|
||||||
touch src/mcp_wiki/server.py # Your MCP server code (tool, resources, prompts)
|
touch src/mcp_wiki/server.py
|
||||||
touch src/mcp_wiki/__init__.py # Primary CLI entry point
|
touch src/mcp_wiki/__main__.py
|
||||||
touch src/mcp_wiki/__main__.py # To enable running as a Python module
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Your project directory structure should look like this:
|
Your project directory structure should look like this:
|
||||||
@@ -47,9 +46,10 @@ Your project directory structure should look like this:
|
|||||||
├── pyproject.toml
|
├── pyproject.toml
|
||||||
├── src
|
├── src
|
||||||
│ └── mcp_wiki
|
│ └── mcp_wiki
|
||||||
│ ├── __init__.py
|
│ ├── __init__.py # Primary CLI entry point
|
||||||
│ ├── __main__.py
|
│ ├── __main__.py # To enable running as a Python module
|
||||||
│ └── server.py
|
│ ├── py.typed # Indicates the package supports type hints
|
||||||
|
│ └── server.py # Your MCP server code (tool, resources, prompts)
|
||||||
└── uv.lock
|
└── uv.lock
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -247,24 +247,26 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
To add your MCP server as an extension in Goose:
|
To add your MCP server as an extension in Goose:
|
||||||
|
|
||||||
1. Go to `Settings > Extensions > Add`.
|
1. Click the <PanelLeft className="inline" size={16} /> button in the top-left to open the sidebar
|
||||||
2. Set the `Type` to `StandardIO`.
|
2. Click `Extensions` in the sidebar
|
||||||
3. Provide the ID, name, and description for your extension.
|
3. Set the `Type` to `STDIO`
|
||||||
4. In the `Command` field, provide the absolute path to your executable. For example:
|
4. Provide a name and description for your extension
|
||||||
|
5. In the `Command` field, provide the absolute path to your executable:
|
||||||
```plaintext
|
```plaintext
|
||||||
uv run /full/path/to/mcp-wiki/.venv/bin/mcp-wiki
|
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
|
uvx mcp-wiki
|
||||||
```
|
```
|
||||||
|
|
||||||
For the purposes on this guide, we will show you how to run the local version.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Step 6: Use Your Extension in Goose
|
## Step 6: Use Your Extension in Goose
|
||||||
|
|||||||
Reference in New Issue
Block a user