add flake
setting up dev env and starting MCP services
This commit is contained in:
commit
75960a368c
53
flake.nix
Normal file
53
flake.nix
Normal file
@ -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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user