opencode flake

This commit is contained in:
2025-07-17 13:47:59 -06:00
parent 61a644183a
commit 428cb0f991
4 changed files with 100 additions and 18 deletions

View File

@@ -1,12 +0,0 @@
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}

View File

@@ -7,13 +7,45 @@
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs { inherit system; };
configJsonText = ''
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
},
"playwright": {
"command": "npx",
"args": [
"-y",
"@playwright/mcp@latest",
"--executable-path",
"${pkgs.chromium}/bin/chromium"
]
},
"sequential_thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}
'';
config_json = pkgs.writeText "config.json" configJsonText;
in {
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.bash
pkgs.python313Packages.pyppeteer
pkgs.glib
pkgs.glib.out
pkgs.chromium
pkgs.uv
pkgs.nodejs_22
@@ -22,8 +54,11 @@
export PUPPETEER_EXECUTABLE_PATH=${pkgs.chromium}/bin/chromium
'';
};
packages.run = pkgs.writeShellScriptBin "run_flake" ''
uvx mcpo --port 8008 --config ./config.json
uvx mcpo --port 8008 --config ${config_json}
'';
packages.config_json = config_json;
});
}
}

View File

@@ -1,4 +1,2 @@
#!/usr/bin/env bash
# Run MCP server using flake devShell
nix develop .#default --command run_flake
nix run .#run