Skip to content

Commit ac95497

Browse files
Slim/0.0.11 (#94)
* log pulls * cleanup mcp client go loop * Fix the read-loop problems * Update atlassian schema * update function_write_files container
1 parent 7cf3590 commit ac95497

File tree

15 files changed

+517
-151
lines changed

15 files changed

+517
-151
lines changed

dev/http_client.clj

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
(ns http-client
2+
(:require
3+
[babashka.curl :as curl]
4+
[cheshire.core :as json]
5+
[clojure.java.io :as io])
6+
(:import
7+
[java.io BufferedInputStream]))
8+
9+
(def connect-response
10+
(curl/get "https://gitmcp.io/docker/labs-ai-tools-for-devs/sse"
11+
{:headers {"Accept" "text/event-stream"
12+
"Connection" "keep-alive"}
13+
:as :stream}))
14+
15+
(defn event-reader [response name]
16+
(.start
17+
(Thread.
18+
(fn []
19+
(let [rdr (io/reader (BufferedInputStream. (:body response)))]
20+
(loop []
21+
(let [line (.readLine rdr)]
22+
(when line
23+
(println (format "%s: %s" name line))
24+
(recur))))
25+
(println (format "%s: %s" name "done reading stream")))))))
26+
27+
(event-reader connect-response "connect")
28+
29+
(defn initialize [url]
30+
(curl/post (format "https://gitmcp.io/slimslenderslacks/hani%s" url)
31+
{:headers {"Accept" "text/event-stream"
32+
"Content-Type" "application/json"
33+
"Connection" "keep-alive"}
34+
:throw false
35+
:body (json/generate-string {:jsonrpc "2.0"
36+
:method "initialize"
37+
:id 0
38+
:params {:protocolVersion "2024-11-05"
39+
:capabilities {}
40+
:clientInfo {:name "SSE Client" :version "0.1"}}}) }))
41+
42+
;; must be 202 Accepted
43+
(def initialize-response (initialize "/*/message?sessionId=b55383c621227380ce7e6182347c49cf1b12270501cc29fb9745b72732b32907"))
44+
45+
(defn tool-list [url]
46+
(curl/post (format "https://gitmcp.io/slimslenderslacks/hani%s" url)
47+
{:headers {"Accept" "text/event-stream"
48+
"Content-Type" "application/json"
49+
"Connection" "keep-alive"}
50+
:throw false
51+
:body (json/generate-string {:jsonrpc "2.0"
52+
:method "tools/list"
53+
:id 1
54+
:params {}}) }))
55+
56+
(def tool-list-response (tool-list "/*/message?sessionId=b55383c621227380ce7e6182347c49cf1b12270501cc29fb9745b72732b32907"))
57+
(.close (:body connect-response))
58+

functions/github-mcp-server/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ RUN apk add --no-cache ca-certificates
33

44
WORKDIR /server
55
COPY --from=ghcr.io/github/github-mcp-server /server/github-mcp-server .
6-
ENTRYPOINT ["/server/github-mcp-server", "stdio"]
6+
ENTRYPOINT ["/server/github-mcp-server", "stdio"]

functions/write_files/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ RUN --mount=type=cache,target=/nix,from=nixos/nix:2.21.1,source=/nix \
2020
--log-format raw \
2121
build . --out-link /tmp/output/result
2222
cp -R $(nix-store -qR /tmp/output/result) /tmp/nix-store-closure
23-
## compute SBOM for the entire runtime graph
24-
#nix \
25-
#--extra-experimental-features "nix-command flakes" \
26-
#run github:tiiuae/sbomnix#sbomnix -- /tmp/output/result --spdx /tmp/sbom.spdx.json
2723
EOF
2824

2925
FROM scratch

functions/write_files/flake.nix

Lines changed: 55 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,60 @@
3535
cp init.clj $out
3636
'';
3737
};
38-
entrypoint = pkgs.writeShellScriptBin "entrypoint" ''
39-
${pkgs.babashka}/bin/bb ${scripts} "$@"
40-
'';
41-
packages = rec {
42-
default = pkgs.buildEnv {
43-
name = "install";
44-
paths = [
45-
pkgs.coreutils
46-
entrypoint
47-
];
48-
};
49-
};
50-
51-
devShells.default = pkgs.devshell.mkShell {
52-
name = "devshell";
53-
packages = with pkgs; [ babashka clojure ];
5438

55-
commands = [
56-
];
57-
};
58-
});
39+
entrypoint = pkgs.writeShellScriptBin "entrypoint" ''
40+
# Check if an argument was provided
41+
if [ $# -eq 0 ]; then
42+
echo "Error: No JSON argument provided"
43+
echo "Usage: $0 '{\"files\": [{\"path\": \"path\", \"executable\": false, \"content\": \"content\"}]}'"
44+
exit 1
45+
fi
46+
47+
# Store the JSON input
48+
json_input="$1"
49+
50+
# Validate JSON structure
51+
if ! echo "$json_input" | ${pkgs.jq}/bin/jq . &> /dev/null; then
52+
echo "Error: Invalid JSON format"
53+
exit 1
54+
fi
55+
56+
# Check if the JSON has the expected structure
57+
if ! echo "$json_input" | ${pkgs.jq}/bin/jq -e '.files' &> /dev/null; then
58+
echo "Error: JSON does not contain 'files' array"
59+
exit 1
60+
fi
61+
62+
# Get the number of files
63+
file_count=$(echo "$json_input" | ${pkgs.jq}/bin/jq '.files | length')
64+
65+
# Initialize an array to store successfully written file paths
66+
declare -a written_files
67+
68+
# Process each file in the array
69+
for ((i=0; i<$file_count; i++)); do
70+
# Extract file information
71+
path=$(echo "$json_input" | ${pkgs.jq}/bin/jq -r ".files[$i].path")
72+
executable=$(echo "$json_input" | ${pkgs.jq}/bin/jq -r ".files[$i].executable")
73+
content=$(echo "$json_input" | ${pkgs.jq}/bin/jq -r ".files[$i].content")
74+
75+
# Write the content to the file
76+
echo "$content" > "$path"
77+
78+
# Check if the write was successful
79+
if [ $? -eq 0 ]; then
80+
# Add to the list of successfully written files
81+
written_files+=("$path")
82+
else
83+
echo "Error: Failed to write to $path"
84+
fi
85+
done
86+
87+
printf "wrote files: \n"
88+
exit 0
89+
90+
'';
91+
92+
packages.default = entrypoint;
93+
});
5994
}

functions/write_files/init.clj

Lines changed: 0 additions & 40 deletions
This file was deleted.

functions/write_files/runbook.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ The `write_file` function has wo parameters.
1010
This function should be given a rw bind mount for the root of a project.
1111

1212
```sh
13-
docker run --rm --mount type=bind,source=$PWD,target=/project
14-
--workdir /project
15-
vonwig/function_write_files:latest
16-
"$(echo '{"files":[{"path":"file1.txt","content":"hellow world"}]}')"
13+
docker run --rm --mount type=bind,source=$PWD,target=/project \
14+
--workdir /project \
15+
vonwig/function_write_files:latest \
16+
'{"files":[{"path":"file1.txt","content":"hellow world"}]}'
1717
```
1818

1919
## Build
2020

21+
```sh
22+
docker build -t vonwig/function_write_files:latest .
23+
```
24+
2125
```sh
2226
# docker:command=build
2327

prompts/catalog.yaml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ registry:
33
description: The MCP SQLite promptfile contributes all of the tools necessary to work with SQLite and SQLite databases. The file also includes a prompt to seed the database with initial data which helps to demonstrate what you can do with an SQLite MCP Server.
44
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/mcp-sqlite.md
55
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/sqlite.md
6+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/mcp-sqlite.md
67
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/sqlite.svg
78
tools:
89
- name: read-query
@@ -16,6 +17,7 @@ registry:
1617
curl:
1718
description: This prompt file contains the standard curl tool. In addition to the tool itself, you get a tool to read the latest man page to help clear up any issues. It also contains a prompt to demonstrate how to use the tool in a multi-step process.
1819
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/curl.md
20+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/curl.md
1921
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/curl.svg
2022
tools:
2123
- name: curl-manual
@@ -25,6 +27,7 @@ registry:
2527
ffmpeg:
2628
description: Use ffmpeg to process video files. This prompt file contains the ffmpeg tool, and a tool to read the latest man page to help clear up any issues. It also contains a prompt to demonstrate how to use the tool in a multi-step process.
2729
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/ffmpeg.md
30+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/ffmpeg.md
2831
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/ffmpeg.svg
2932
tools:
3033
- name: imagemagick-manual
@@ -36,6 +39,7 @@ registry:
3639
qr code:
3740
description: Generate a qrcode for an input text string
3841
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/qrencode.md
42+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/qrencode.md
3943
icon: https://2.gravatar.com/userimage/39790510/4918b92358fde20da56c0ec8e5ac7a23?size=256
4044
tools:
4145
- name: qrencode
@@ -45,6 +49,7 @@ registry:
4549
description: Give your MCP client a memory system! This prompt file contains a tool to create entities, relations, and observations in a knowledge graph. It also contains a tool to read the latest man page to help clear up any issues. It also contains a prompt to demonstrate how to use the tool in a multi-step process.
4650
ref: github:docker/labs-ai-tools-for-devs?path=prompts/examples/mcp-memory.md
4751
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/memory.md
52+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/mcp-memory.md
4853
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/knowledgebase.svg
4954
tools:
5055
- name: create_entities
@@ -61,6 +66,7 @@ registry:
6166
chrome:
6267
description: Drive a headless Chrome browser to interact with web pages
6368
ref: github:docker/labs-ai-tools-for-devs?path=prompts/chrome.md
69+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/chrome.md
6470
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/googlechrome.svg
6571
tools:
6672
- name: interact-with-chrome
@@ -72,6 +78,7 @@ registry:
7278
sequentialthinking:
7379
description: A tool for dynamic and reflective problem-solving through a structured thinking process
7480
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/examples/sequentialthinking.md
81+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/sequentialthinking.md
7582
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/sequentialthinking.md
7683
icon: https://d3t3ozftmdmh3i.cloudfront.net/production/podcast_uploaded_nologo/2454513/2454513-1570719639731-bfdf3620a4e0d.jpg
7784
tools:
@@ -205,6 +212,9 @@ registry:
205212
description: This MCP server integrates with Google Drive to allow listing, reading, and searching over files
206213
ref: github:docker/labs-ai-tools-for-devs?path=prompts/mcp/gdrive.md
207214
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/googledrive.svg
215+
source: https://github.com/modelcontextprotocol/servers/tree/2025.4.6/src/gdrive
216+
secrets:
217+
- name: google.gcp-oauth.keys.json
208218
tools:
209219
- name: gdrive_auth
210220
secrets:
@@ -236,6 +246,7 @@ registry:
236246
description: A Model Context Protocol server for Git repository interaction and automation
237247
ref: github:docker/labs-ai-tools-for-devs?path=prompts/examples/git.md
238248
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/git.md
249+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/examples/git.md
239250
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/git.svg
240251
tools:
241252
- name: git
@@ -315,7 +326,7 @@ registry:
315326
Local filesystem access with configurable allowed paths
316327
ref: github:docker/labs-ai-tools-for-devs?path=prompts/mcp/filesystem.md
317328
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/filesystem.md
318-
source: https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem
329+
source: https://github.com/modelcontextprotocol/servers/tree/2025.4.6
319330
icon: https://avatars.githubusercontent.com/u/182288589?s=200&v=4
320331
tools: []
321332
prompts: 0
@@ -344,6 +355,7 @@ registry:
344355
postgres readonly:
345356
description: Connect with read-only access to PostgreSQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.
346357
ref: github:docker/labs-ai-tools-for-devs?path=prompts/mcp/postgres.md
358+
source: https://github.com/modelcontextprotocol/servers/tree/2025.4.6
347359
icon: https://img.icons8.com/ios/50/postgreesql.png
348360
tools: []
349361
secrets:
@@ -384,6 +396,7 @@ registry:
384396
description: |
385397
Bootstrap new tools from your MCP client
386398
ref: github:docker/labs-ai-tools-for-devs?path=prompts/bootstrap.md
399+
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/prompts/bootstrap.md
387400
icon: https://avatars.githubusercontent.com/u/182288589?s=200&v=4
388401
tools:
389402
- name: tool-registration
@@ -467,10 +480,16 @@ registry:
467480
- name: jira_transition_issue
468481
- name: jira_update_issue
469482
secrets:
470-
- name: atlassian.jira.token
471-
- name: atlassian.confluence.token
472483
prompts: 0
473484
resources: {}
485+
- name: atlassian.jira.api_token
486+
required: false
487+
- name: atlassian.confluence.api_token
488+
required: false
489+
- name: atlassian.jira.personal_token
490+
required: false
491+
- name: atlassian.confluence.personal_token
492+
required: false
474493
config:
475494
- name: atlassian
476495
description: The MCP server is allowed to access these paths
@@ -655,8 +674,8 @@ registry:
655674
description: Provides seamless integration with GitHub APIs, enabling advanced automation and interaction capabilities for developers and tools.
656675
ref: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/github-official.md
657676
readme: github:docker/labs-ai-tools-for-devs?ref=main&path=prompts/mcp/readmes/github-official.md
658-
source: https://github.com/docker/labs-ai-tools-for-devs/tree/main/functions/github-mcp-server
659-
icon: https://avatars.githubusercontent.com/u/9919?s=200&v=4
677+
source: https://github.com/github/github-mcp-server
678+
icon: https://cdn.jsdelivr.net/npm/simple-icons@v7/icons/github.svg
660679
tools:
661680
- name: add_issue_comment
662681
- name: create_branch

prompts/mcp/atlassian.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ mcp:
1111
CONFLUENCE_USERNAME: "{{atlassian.confluence.username}}"
1212
JIRA_URL: "{{atlassian.jira.url}}"
1313
JIRA_USERNAME: "{{atlassian.jira.username}}"
14+
secrets:
15+
atlassian.jira.personal_token: JIRA_PERSONAL_TOKEN
16+
atlassian.confluence.personal_token: CONFLUENCE_PERSONAL_TOKEN
17+
atlassian.jira.api_token: JIRA_API_TOKEN
18+
atlassian.confluence.api_token: CONFLUENCE_API_TOKEN
1419
source:
1520
url: https://github.com/sooperset/mcp-atlassian/tree/main
1621
---

runbook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ docker pull mcp/docker:prerelease
2020

2121
```sh
2222
# docker:command=build-release
23-
VERSION="0.0.10"
23+
VERSION="0.0.11"
2424
docker buildx build \
2525
--builder hydrobuild \
2626
--platform linux/amd64,linux/arm64 \

0 commit comments

Comments
 (0)