From 605693cb49a2f79efc059f05d075c1776f3f4a10 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 22 Aug 2026 04:48:21 +0000 Subject: [PATCH 1/2] Add Cursor MCP spawn config for the existing promptforge server. Cursor reads .cursor/mcp.json and starts `promptforge-mcp-server serve --stdio prompts.toml`. That is the harness spawn already documented; this file is only the Cursor-side recipe. Considered a second prompts.toml or a new MCP tool per prompt; both already exist as one catalog behind list_prompts/run_prompt, so nothing new was added there. Co-authored-by: Rob Beeston --- .cursor/mcp.json | 17 +++++++++++++++++ README.md | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 .cursor/mcp.json diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 000000000..6404d7c5b --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,17 @@ +{ + "mcpServers": { + "promptforge": { + "command": "cargo", + "args": [ + "run", + "--quiet", + "-p", + "promptforge-mcp-server", + "--", + "serve", + "--stdio", + "prompts.toml" + ] + } + } +} diff --git a/README.md b/README.md index 6148152f0..12a2dd889 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,10 @@ Interactive prompt work against an already-running gateway: cargo run -p promptforge-dev -- prompts/greet.md "world" --watch ``` +### Cursor + +This repo ships `.cursor/mcp.json`, which spawns `promptforge-mcp-server` over stdio using `prompts.toml`. Start a gateway first, then set `PROMPTFORGE_GATEWAY_API_KEY` in the environment Cursor inherits, or put it in `prompts.env` next to `prompts.toml` (gitignored). Enable the **promptforge** MCP server in Cursor Settings → MCP. The harness then has four tools: `list_prompts`, `run_prompt`, `check_run`, and `need_prompt`. Ask the agent to list prompts or to run `hello`. + ![Gloves and sparks](images/banner-04.png) ## How it works From 8f23ecc95c43d328c5ad32fdb277cb3485d11264 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 22 Aug 2026 05:21:10 +0000 Subject: [PATCH 2/2] Point local Cursor/MCP at Ollama with a fixed loopback password. The development prompts.toml and a new gateway.ollama.toml both use the bearer `whatever` and openhermes:latest, so a local Ollama install does not need vendor keys or a matching env file. Web search stays off on that profile because it is a Brave credential, which this path does not have. Considered interpolating PROMPTFORGE_GATEWAY_API_KEY; that was the scavenger hunt this change removes. Co-authored-by: Rob Beeston --- README.md | 8 +++++++- gateway.ollama.toml | 23 +++++++++++++++++++++++ prompts.toml | 12 +++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 gateway.ollama.toml diff --git a/README.md b/README.md index 12a2dd889..8e61844ee 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,13 @@ cargo run -p promptforge-dev -- prompts/greet.md "world" --watch ### Cursor -This repo ships `.cursor/mcp.json`, which spawns `promptforge-mcp-server` over stdio using `prompts.toml`. Start a gateway first, then set `PROMPTFORGE_GATEWAY_API_KEY` in the environment Cursor inherits, or put it in `prompts.env` next to `prompts.toml` (gitignored). Enable the **promptforge** MCP server in Cursor Settings → MCP. The harness then has four tools: `list_prompts`, `run_prompt`, `check_run`, and `need_prompt`. Ask the agent to list prompts or to run `hello`. +This repo ships `.cursor/mcp.json`, which spawns `promptforge-mcp-server` over stdio using `prompts.toml`. For a local Ollama model, start the matching gateway (loopback password `whatever`, already set in both files): + +```bash +cargo run -p promptforge-gateway -- serve gateway.ollama.toml +``` + +Enable the **promptforge** MCP server in Cursor Settings → MCP. The harness then has four tools: `list_prompts`, `run_prompt`, `check_run`, and `need_prompt`. Ask the agent to list prompts or to run `hello`. ![Gloves and sparks](images/banner-04.png) diff --git a/gateway.ollama.toml b/gateway.ollama.toml new file mode 100644 index 000000000..510e92829 --- /dev/null +++ b/gateway.ollama.toml @@ -0,0 +1,23 @@ +# Local Ollama backend. No vendor keys. Serve from the repo root: +# cargo run -p promptforge-gateway -- serve gateway.ollama.toml +# +# The loopback password is the literal `whatever`. The MCP server in +# prompts.toml uses the same string. Point `upstream` at `ollama list`. + +[server] +bind = "127.0.0.1:8081" +api_key = "whatever" + +[[endpoint]] +id = "ollama" +protocol = "openai" +base_url = "http://127.0.0.1:11434/v1" +api_key = "" + +[[model]] +name = "writer" +description = "A model suited for careful analysis, coding, and general assistance" +context = 8192 +thinking = "never" +upstream = "openhermes:latest" +endpoints = ["ollama"] diff --git a/prompts.toml b/prompts.toml index 2117c8885..da8a5e07e 100644 --- a/prompts.toml +++ b/prompts.toml @@ -16,16 +16,18 @@ api_key = "${PROMPTFORGE_MCP_SERVER_API_KEY}" [paths] prompts = "prompts" -# The prompts run against the same gateway the CLI uses; it holds the vendor key. +# The prompts run against the same gateway the CLI uses. The password is a +# local loopback bearer, not a vendor key; it must match [server].api_key in +# gateway.ollama.toml. [gateway] url = "http://127.0.0.1:8081/v1" -api_key = "${PROMPTFORGE_GATEWAY_API_KEY}" +api_key = "whatever" -# Live tools: both enabled here to preserve the development profile's behavior. -# A configuration with no [tools] section runs in a true sandbox. +# Fetch is local. Search needs a gateway [tools.web_search] provider; the +# Ollama profile does not ship one, so it stays off here. [tools] web_fetch = true -web_search = true +web_search = false # Everything written under prompts/ is available. `*` stops at a separator and # `**` crosses one, so `**/*.md` reaches a prompt in a subdirectory too. The