Skip to main content

gcontext connector — local MCP bridge: cloud structure, local secret values

Project description

mcp-minimal

A single local Python MCP server: a files/folders tree + a secret-name registry in SQLite, plus on-the-fly Python script execution with the local .env injected. Secret VALUES never leave this machine and never enter the database.

Setup

cd apps/mcp-minimal
cp .env.example .env   # fill in your secret values

Get a token first by running uvx gcontext-mcp login (browser sign-in at https://app.gcontext.ai mints it).

Add to Claude Code

Published connector (hosted cloud):

claude mcp add-json gcontext '{
  "type": "stdio",
  "command": "uvx",
  "args": ["gcontext-mcp"],
  "env": { "GCONTEXT_TOKEN": "<your token>" }
}'

Pure-local (no cloud, own SQLite):

claude mcp add mcp-minimal -- uv run --directory /ABS/PATH/TO/apps/mcp-minimal python server.py

Add to Claude Desktop

The CLI commands above only work in Claude Code. For the Desktop app, edit the config file directly (Settings → Developer → Edit Config, or open it from):

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add your server under mcpServers, then fully quit and reopen Claude Desktop.

Published connector (hosted cloud):

{
  "mcpServers": {
    "gcontext": {
      "command": "uvx",
      "args": ["gcontext-mcp"],
      "env": { "GCONTEXT_TOKEN": "<your token>" }
    }
  }
}

Pure-local (no cloud, own SQLite):

{
  "mcpServers": {
    "mcp-minimal": {
      "command": "uv",
      "args": ["run", "--directory", "/ABS/PATH/TO/apps/mcp-minimal", "python", "server.py"]
    }
  }
}

Note: Desktop has no slash-command prompts (/use-integration, etc.) — you drive the same tools by plain chat. Both modes need uv/uvx on your PATH.

Tools

  • tool_list_dir(path="/"), tool_read_file(path), tool_write_file(path, content), tool_create_folder(path), tool_delete(path)
  • tool_list_secrets(), tool_register_secret(name, description), tool_unregister_secret(name), tool_scaffold_env()
  • tool_run_script(code) - runs uv run --env-file .env python -c "<code>"

The secret registry

The registry holds secret NAMES + descriptions only — it is for setup and verification, not runtime. It does NOT gate tool_run_script, which injects the whole .env regardless of what's registered.

  1. tool_register_secret(name, description) - declare a required secret.
  2. tool_scaffold_env() - append blank NAME= lines to .env for any registered secret not yet present, so the user just fills in the values.
  3. tool_list_secrets() - shows present_locally per name so you can confirm setup.

How it works

  1. Write a file describing a 3rd-party operation and which secret NAMES it needs; declare those names with tool_register_secret.
  2. To act, read the file, generate Python, and call tool_run_script.
  3. Secret values resolve from the local .env at run time - never stored in the DB.

Security / trust model

tool_run_script runs arbitrary Python locally with your real .env injected — there is no sandbox. It is exactly as trusted as whatever drives the server. Run it on your own machine only; never expose this server remotely.

Script contract

  • Read secrets via os.environ["VAR"] - never hardcode, never load_dotenv.
  • Use only registered names that show present_locally: true.
  • Exit codes: 0 OK, 2 missing secret (KeyError), 1 any other failure.

Config (env vars)

  • MCP_MINIMAL_DB - SQLite path (default db.sqlite next to server.py).
  • MCP_MINIMAL_ENV_FILE - secret-values file (default .env next to server.py).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gcontext_mcp-0.1.3.tar.gz (140.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gcontext_mcp-0.1.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file gcontext_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: gcontext_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 140.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.16

File hashes

Hashes for gcontext_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 667857afd04b8565358596490873efa8d5bbcfd5e95323c79e805dd6f090e8b4
MD5 b8b1a7346b13d75bbf2cd0d7111038cf
BLAKE2b-256 9831f1fabacd79134b8ede3e2cd31977799c7ecc0c7bc186a19d38dea2ddf8e0

See more details on using hashes here.

File details

Details for the file gcontext_mcp-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gcontext_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d59e70992c6c5cd222acb7c643fea539f2d0d3c9572f5cc3d3f82c8b0263efd1
MD5 64b92f1e16929ce12f5b14330a6629b4
BLAKE2b-256 6b9c51629ddbb607b8f08e3f01e36965f3256d46f8e4ac72a062404338e6874d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page