commit 75960a368c882916b146bc9493b9cd9ba5ff9094 Author: WieErWill Date: Wed Jun 11 19:12:14 2025 +0000 add flake setting up dev env and starting MCP services diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..474d438 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "MCP-Experiment mit SQLite, Ollama und Qwen-LLM"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in { + devShell = pkgs.mkShell { + name = "mcp-experiment-shell"; + buildInputs = with pkgs; [ + go + jq + nodejs + ollama + python310 + sqlite + tmux + ]; + + shellHook = '' + echo "Installiere Python-Tools..." + pip install --user uv + + echo "Installiere NodeJS-Tools..." + npm install @modelcontextprotocol/server-filesystem + + echo "Installiere mcphost über Go..." + export GOPATH=$HOME/go + export PATH=$GOPATH/bin:$PATH + go install github.com/mark3labs/mcphost@latest + + # check that "ollama serve" is running + + echo "Lade Qwen-LLM in Ollama..." + ollama pull qwen2.5 + + # tmux-Session mit mehreren Fenstern + session="mcp" + if ! tmux has-session -t $session 2>/dev/null; then + tmux new-session -d -s $session -n sqlite "uvx mcp-server-sqlite --db-path ./Car_Database.db" + tmux new-window -t $session:1 -n fs "npx @modelcontextprotocol/server-filesystem ." + tmux new-window -t $session:2 -n ollama "ollama run --model qwen2.5" + tmux new-window -t $session:3 -n host "mcphost -m ollama:qwen2.5 --config ./config.json" + fi + tmux attach -t $session + ''; + }; + }); +}