-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add MCP server example * Update examples/mcp-server/README.md
- Loading branch information
Showing
6 changed files
with
409 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mcp-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Gitpod MCP Server | ||
|
||
A Model Control Protocol (MCP) server that provides access to Gitpod resources and operations through Claude. | ||
|
||
## Features | ||
|
||
- List Gitpod projects | ||
- List Gitpod environments | ||
- Create new environments | ||
- Stop environments | ||
- Execute commands in environments | ||
|
||
## Claude Desktop Configuration | ||
|
||
1. Create a file containing your Gitpod personal access token: | ||
```bash | ||
echo "your_api_key_here" > /tmp/gitpod-personal-access-token.txt | ||
``` | ||
|
||
2. Build the server: | ||
```bash | ||
go build -o /tmp/gitpod-mcp | ||
``` | ||
|
||
3. Add the following to your Claude Desktop configuration to enable Gitpod integration: | ||
|
||
```json | ||
{ | ||
"mcpServers": { | ||
"gitpod": { | ||
"command": "/tmp/gitpod-mcp", | ||
"env": { | ||
"GITPOD_API_KEY": "your-key-here", | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
>**Note:** Don't forget to delete the token file after you're done. | ||
## Available Resources | ||
|
||
- `gitpod://projects` - List all available Gitpod projects | ||
- `gitpod://environments` - List current Gitpod environments | ||
|
||
## Available Tools | ||
|
||
### create_environment | ||
Creates a new Gitpod environment for a project. | ||
- Parameters: | ||
- `project_id` (string, required): The ID of the project to create the environment in | ||
|
||
### stop_environment | ||
Stops a running Gitpod environment. | ||
- Parameters: | ||
- `environment_id` (string, required): The ID of the environment to stop | ||
|
||
### execute_command | ||
Executes a command in a Gitpod environment. | ||
- Parameters: | ||
- `environment_id` (string, required): The ID of the environment to execute the command in | ||
- `command` (string, required): The command to execute (runs as a bash script in project root) | ||
- `description` (string, required): A short description of the command (max 200 characters) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module github.com/gitpod-io/gitpod-sdk-go/examples/mcp-server | ||
|
||
go 1.23.0 | ||
|
||
replace github.com/gitpod-io/gitpod-sdk-go => ../.. | ||
|
||
require github.com/mark3labs/mcp-go v0.8.4 | ||
|
||
require ( | ||
github.com/gitpod-io/gitpod-sdk-go v0.0.0-00010101000000-000000000000 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/tidwall/gjson v1.14.4 // indirect | ||
github.com/tidwall/match v1.1.1 // indirect | ||
github.com/tidwall/pretty v1.2.1 // indirect | ||
github.com/tidwall/sjson v1.2.5 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | ||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= | ||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
github.com/mark3labs/mcp-go v0.8.4 h1:/VxjJ0+4oN2eYLuAgVzixrYNfrmwJnV38EfPIX3VbPE= | ||
github.com/mark3labs/mcp-go v0.8.4/go.mod h1:cjMlBU0cv/cj9kjlgmRhoJ5JREdS7YX83xeIG9Ko/jE= | ||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= | ||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= | ||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= | ||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= | ||
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= | ||
github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= | ||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= | ||
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= | ||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= | ||
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= | ||
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= | ||
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
Oops, something went wrong.