gptscript icon indicating copy to clipboard operation
gptscript copied to clipboard

feat: add MCP support

Open ibuildthecloud opened this issue 8 months ago • 1 comments

Example

chat: true
tools: arbtrary-tool-name

You're an expert at SQLite. Ask the user how you can help them.

---
name: arbtrary-tool-name

#!mcp
{
  "mcpServers": {
    "sqlite": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-v",
        "mcp-test:/mcp",
        "mcp/sqlite",
        "--db-path",
        "/mcp/test.db"
      ]
    }
  }
}

ibuildthecloud avatar Apr 19 '25 05:04 ibuildthecloud

While testing this out I ran into two issues

  1. Gptscript created a new docker instance per tool call, it's supposed to reuse the same container.
  2. It was not able to get the output from the tool, not sure why.
Name: gitops
Tools: gitlab
Chat: true

---
Name: gitlab

#!mcp
{
  "mcpServers": {
    "gitlab": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "GITLAB_PERSONAL_ACCESS_TOKEN",
        "-e",
        "GITLAB_API_URL",
        "mcp/gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "xxxxxx",
        "GITLAB_API_URL": "http://gitlab.cloudnautique.com:8929/api/v4"
      }
    }
  }
}

cloudnautique avatar Apr 28 '25 19:04 cloudnautique