Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

Commit 0f77d32

Browse files
support raw mcp servers (#56)
Support refs that proxy mcp servers. Add secrets to container definitions.
1 parent 091b46a commit 0f77d32

File tree

14 files changed

+595
-245
lines changed

14 files changed

+595
-245
lines changed

dev/catalog.clj

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[babashka.fs :as fs]
44
[clj-yaml.core :as yaml]
55
git
6+
[markdown :as markdown-parser]
67
[medley.core :as medley]
78
prompts))
89

@@ -27,14 +28,25 @@
2728
(map tile-metadata)))
2829

2930
(spit "catalog.updated.yaml"
30-
(yaml/generate-string
31-
(let [catalog (yaml/parse-string (slurp "prompts/catalog.yaml"))]
32-
(medley/deep-merge
33-
catalog
34-
{:registry
35-
(->> (apply interleave ((juxt keys (comp extra-metadata vals)) (seq (:registry catalog))))
36-
(partition 2)
37-
(map #(into [] %))
38-
(into {})
39-
)}))))
31+
(yaml/generate-string
32+
(let [catalog (yaml/parse-string (slurp "prompts/catalog.yaml"))]
33+
(medley/deep-merge
34+
catalog
35+
{:registry
36+
(->> (apply interleave ((juxt keys (comp extra-metadata vals)) (seq (:registry catalog))))
37+
(partition 2)
38+
(map #(into [] %))
39+
(into {}))}))))
4040

41+
(def catalog (yaml/parse-string (slurp "prompts/catalog.yaml")))
42+
(def local-prompt-files
43+
(->> catalog
44+
:registry
45+
vals
46+
(map :ref)
47+
(map git/prompt-file)))
48+
49+
(map f->prompt local-prompt-files)
50+
51+
(markdown-parser/parse-markdown (slurp "prompts/examples/sequentialthinking.md"))
52+
(prompts/get-prompts {:prompt-content (slurp "prompts/examples/sequentialthinking.md")})
Lines changed: 71 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,95 @@
11
---
22
tools:
33
- name: sequentialthinking
4-
description: |
5-
A detailed tool for dynamic and reflective problem-solving through thoughts.
6-
This tool helps analyze problems through a flexible thinking process that can adapt and evolve.
7-
Each thought can build on, question, or revise previous insights as understanding deepens.
4+
description: |-
5+
A detailed tool for dynamic and reflective problem-solving through thoughts.
6+
This tool helps analyze problems through a flexible thinking process that can adapt and evolve.
7+
Each thought can build on, question, or revise previous insights as understanding deepens.
8+
9+
When to use this tool:
10+
- Breaking down complex problems into steps
11+
- Planning and design with room for revision
12+
- Analysis that might need course correction
13+
- Problems where the full scope might not be clear initially
14+
- Problems that require a multi-step solution
15+
- Tasks that need to maintain context over multiple steps
16+
- Situations where irrelevant information needs to be filtered out
17+
18+
Key features:
19+
- You can adjust total_thoughts up or down as you progress
20+
- You can question or revise previous thoughts
21+
- You can add more thoughts even after reaching what seemed like the end
22+
- You can express uncertainty and explore alternative approaches
23+
- Not every thought needs to build linearly - you can branch or backtrack
24+
- Generates a solution hypothesis
25+
- Verifies the hypothesis based on the Chain of Thought steps
26+
- Repeats the process until satisfied
27+
- Provides a correct answer
28+
29+
Parameters explained:
30+
- thought: Your current thinking step, which can include:
31+
* Regular analytical steps
32+
* Revisions of previous thoughts
33+
* Questions about previous decisions
34+
* Realizations about needing more analysis
35+
* Changes in approach
36+
* Hypothesis generation
37+
* Hypothesis verification
38+
- next_thought_needed: True if you need more thinking, even if at what seemed like the end
39+
- thought_number: Current number in sequence (can go beyond initial total if needed)
40+
- total_thoughts: Current estimate of thoughts needed (can be adjusted up/down)
41+
- is_revision: A boolean indicating if this thought revises previous thinking
42+
- revises_thought: If is_revision is true, which thought number is being reconsidered
43+
- branch_from_thought: If branching, which thought number is the branching point
44+
- branch_id: Identifier for the current branch (if any)
45+
- needs_more_thoughts: If reaching end but realizing more thoughts needed
46+
47+
You should:
48+
1. Start with an initial estimate of needed thoughts, but be ready to adjust
49+
2. Feel free to question or revise previous thoughts
50+
3. Don't hesitate to add more thoughts if needed, even at the "end"
51+
4. Express uncertainty when present
52+
5. Mark thoughts that revise previous thinking or branch into new paths
53+
6. Ignore information that is irrelevant to the current step
54+
7. Generate a solution hypothesis when appropriate
55+
8. Verify the hypothesis based on the Chain of Thought steps
56+
9. Repeat the process until satisfied with the solution
57+
10. Provide a single, ideally correct answer as the final output
58+
11. Only set next_thought_needed to false when truly done and a satisfactory answer is reached`
859
9-
When to use this tool:
10-
- Breaking down complex problems into steps
11-
- Planning and design with room for revision
12-
- Analysis that might need course correction
13-
- Problems where the full scope might not be clear initially
14-
- Problems that require a multi-step solution
15-
- Tasks that need to maintain context over multiple steps
16-
- Situations where irrelevant information needs to be filtered out
17-
18-
Key features:
19-
- You can adjust total_thoughts up or down as you progress
20-
- You can question or revise previous thoughts
21-
- You can add more thoughts even after reaching what seemed like the end
22-
- You can express uncertainty and explore alternative approaches
23-
- Not every thought needs to build linearly - you can branch or backtrack
24-
- Generates a solution hypothesis
25-
- Verifies the hypothesis based on the Chain of Thought steps
26-
- Repeats the process until satisfied
27-
- Provides a correct answer
28-
29-
Parameters explained:
30-
- thought: Your current thinking step, which can include:
31-
* Regular analytical steps
32-
* Revisions of previous thoughts
33-
* Questions about previous decisions
34-
* Realizations about needing more analysis
35-
* Changes in approach
36-
* Hypothesis generation
37-
* Hypothesis verification
38-
- next_thought_needed: True if you need more thinking, even if at what seemed like the end
39-
- thought_number: Current number in sequence (can go beyond initial total if needed)
40-
- total_thoughts: Current estimate of thoughts needed (can be adjusted up/down)
41-
- is_revision: A boolean indicating if this thought revises previous thinking
42-
- revises_thought: If is_revision is true, which thought number is being reconsidered
43-
- branch_from_thought: If branching, which thought number is the branching point
44-
- branch_id: Identifier for the current branch (if any)
45-
- needs_more_thoughts: If reaching end but realizing more thoughts needed
46-
47-
You should:
48-
1. Start with an initial estimate of needed thoughts, but be ready to adjust
49-
2. Feel free to question or revise previous thoughts
50-
3. Don't hesitate to add more thoughts if needed, even at the "end"
51-
4. Express uncertainty when present
52-
5. Mark thoughts that revise previous thinking or branch into new paths
53-
6. Ignore information that is irrelevant to the current step
54-
7. Generate a solution hypothesis when appropriate
55-
8. Verify the hypothesis based on the Chain of Thought steps
56-
9. Repeat the process until satisfied with the solution
57-
10. Provide a single, ideally correct answer as the final output
58-
11. Only set next_thought_needed to false when truly done and a satisfactory answer is reached`
5960
parameters:
6061
type: object
6162
properties:
6263
thought:
63-
type: "string",
64+
type: string
6465
description: "Your current thinking step"
6566
nextThoughtNeeded:
66-
type: "boolean",
67+
type: boolean
6768
description: "Whether another thought step is needed"
6869
thoughtNumber:
69-
type: "integer"
70-
description: "Current thought number",
70+
type: integer
71+
description: "Current thought number"
7172
minimum: 1
7273
totalThoughts:
73-
type: "integer",
74-
description: "Estimated total thoughts needed",
74+
type: integer
75+
description: "Estimated total thoughts needed"
7576
minimum: 1
7677
isRevision:
77-
type: "boolean",
78+
type: boolean
7879
description: "Whether this revises previous thinking"
79-
revisesThought: {
80-
type: "integer",
81-
description: "Which thought is being reconsidered",
80+
revisesThought:
81+
type: integer
82+
description: "Which thought is being reconsidered"
8283
minimum: 1
8384
branchFromThought:
84-
type: "integer",
85-
description: "Branching point thought number",
85+
type: integer
86+
description: "Branching point thought number"
8687
minimum: 1
8788
branchId:
88-
type: "string",
89+
type: string
8990
description: "Branch identifier"
9091
needsMoreThoughts:
91-
type: "boolean",
92+
type: boolean
9293
description: "If more thoughts are needed"
9394
required:
9495
- thought
@@ -100,3 +101,5 @@ You should:
100101
volumes:
101102
- "mcp-sequentialthinking:/sequentialthinking"
102103
---
104+
105+
# anything

prompts/mcp/brave.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
mcp:
33
- container:
44
image: mcp/brave-search:latest
5-
environment:
6-
BRAVE_API_KEY: "{{ brave.api_key }}"
5+
workdir: /app
6+
secrets:
7+
brave.api_key: BRAVE_API_KEY
78
---
89

prompts/mcp/redis.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@
22
mcp:
33
- container:
44
image: mcp/redis:latest
5+
workdir: /app
6+
secrets:
7+
redis.host: REDIS_HOST
8+
redis.port: REDIS_PORT
9+
command:
10+
- "--redis-host"
11+
- $REDIS_HOST
12+
- "--redis-port"
13+
- $REDIS_PORT
514
---
615

prompts/mcp/slack.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
mcp:
33
- container:
44
image: mcp/slack:latest
5-
environment:
6-
SLACK_BOT_TOKEN: "{{ slack.bot_token }}"
7-
SLACK_TEAM_ID: "{{ slack.team_id }} "
5+
workdir: /app
6+
secrets:
7+
slack.bot_token: SLACK_BOT_TOKEN
8+
slack.team_id: SLACK_TEAM_ID
89
---
910

prompts/mcp/stripe.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
22
mcp:
33
- container:
4-
image: mcp/stripe:latest
4+
image: vonwig/stripe:latest
5+
workdir: /app
6+
secrets:
7+
stripe.api_key: API_KEY
58
command:
69
- "--tools=all"
7-
- "--api-key={{stripe.api_key}}"
10+
- "--api-key=$API_KEY"
811
---
912

runbook.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
```sh
2-
docker build -t mcp/docker .
3-
```
4-
5-
```sh
6-
docker extension rm vonwig/labs-ai-tools-for-devs
2+
docker buildx build \
3+
--builder hydrobuild \
4+
--platform linux/amd64,linux/arm64 \
5+
--tag mcp/docker:0.0.1 \
6+
--file Dockerfile \
7+
--push .
8+
docker pull mcp/docker:0.0.1
79
```
810

911
```sh
10-
docker extension install vonwig/labs-ai-tools-for-devs:0.1.16
12+
cd src/extension && make build-extension
1113
```
1214

1315
```sh
14-
docker extension update docker/labs-ai-tools-for-devs:0.1.4
16+
docker extension update docker/labs-ai-tools-for-devs:0.2.7
1517
```
1618

1719
```sh
@@ -30,10 +32,10 @@ docker pull mcp/docker:prerelease
3032
docker buildx build \
3133
--builder hydrobuild \
3234
--platform linux/amd64,linux/arm64 \
33-
--tag mcp/docker:latest \
35+
--tag mcp/docker:0.0.1 \
3436
--file Dockerfile \
3537
--push .
36-
docker pull mcp/docker:latest
38+
docker pull mcp/docker:0.0.1
3739
```
3840

3941
```sh
@@ -49,11 +51,16 @@ docker run --rm -i --pull always -q --init \
4951
-v /var/run/docker.sock:/var/run/docker.sock \
5052
--mount type=volume,source=docker-prompts,target=/prompts \
5153
-p 8811:8811 \
52-
mcp/docker:latest \
54+
mcp/docker:0.0.1 \
5355
serve --mcp --port 8811 \
54-
--register "github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md"
56+
--register "github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md"
5557
```
5658

5759
```sh
5860
socat STDIO TCP:127.0.0.1:8811
5961
```
62+
63+
```sh
64+
docker x policy set my-policy '*'
65+
docker x secret set 'stripe.api_key=....' --policy my-policy
66+
```

0 commit comments

Comments
 (0)