Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cursor/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"mcpServers": {
"promptforge": {
"command": "cargo",
"args": [
"run",
"--quiet",
"-p",
"promptforge-mcp-server",
"--",
"serve",
"--stdio",
"prompts.toml"
]
}
}
}
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ 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`. 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)

## How it works
Expand Down
23 changes: 23 additions & 0 deletions gateway.ollama.toml
Original file line number Diff line number Diff line change
@@ -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"]
12 changes: 7 additions & 5 deletions prompts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading