agentleFS
byaan-aibyaan-ai/byaan/.agents/skills/byaan:mcp-setup/SKILL.md

byaan:mcp-setup

Skill98 starsChanged 7 months agoMITView on GitHub

Configure the Byaan MCP server in AI coding assistants (Claude Code, Cursor, Codex CLI). Detects the local project, builds the correct stdio config, and installs it into the chosen tool. Only works for local/community mode — not the Mac desktop app.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If NOT_FOUND, look for clues:

    line 21
  2. Very specific:

    If still not found, ask the user for the path to their Byaan project directory.

    line 26
  3. Very specific:

    Check that uv is installed:

    line 32
  4. Distinctive:

    If missing, tell the user:

    line 37
  5. Distinctive:

    Check that the database exists (the app must have been run at least once):

    line 40
  6. Distinctive:

    If the database is missing, tell the user:

    line 45
  7. Very specific:

    Ask the user which AI assistant they want to connect Byaan to.

    line 51
  8. Distinctive:

    No environment variables are needed for community/dev mode — the server auto-detects its database and configuration.

    line 67
  9. Very specific:

    Run the following command (replace <PROJECT_ROOT> with the real path):

    line 73
  10. Distinctive:

    Read the existing file (if it exists):

    line 90
  11. Very specific:

    Be careful: Do NOT overwrite other existing MCP server entries.

    line 108
  12. Distinctive:

    After writing, tell the user:

    line 110
  13. Distinctive:

    Read the existing file:

    line 117
  14. Very specific:

    Check if [mcp_servers.byaan] already exists.

    line 122
  15. Distinctive:

    After configuring, test that the MCP server actually starts:

    line 136
  16. Distinctive:

    If this fails, debug the error and help the user fix it before finishing.

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are an MCP configuration assistant. Your job is to connect Byaan's MCP server to the user's AI coding assistant so they can query databases directly from their editor or terminal.

Important: This skill is for the local community/dev version of Byaan only. If the user is running the Mac desktop app (Tauri), tell them:

The Mac desktop app configures MCP through its built-in UI. Open the Byaan app and click the MCP icon to get setup instructions.

Step 1: Detect Environment

First, confirm we are in the Byaan project directory by checking for the project marker:

test -f pyproject.toml && echo "BYAAN_PROJECT_FOUND" || echo "NOT_FOUND"

If NOT_FOUND, look for clues:

ls server/mcp/stdio_server.py 2>/dev/null && echo "FOUND" || echo "NOT_FOUND"

If still not found, ask the user for the path to their Byaan project directory.

Set PROJECT_ROOT to the absolute path of the Byaan project root (the directory containing pyproject.toml).

Step 2: Verify Prerequisites

Check that uv is installed:

command -v uv && echo "UV_OK" || echo "UV_MISSING"

If missing, tell the user:

uv is required to run the Byaan MCP server. Install it: https://docs.astral.sh/uv/

Check that the database exists (the app must have been run at least once):

test -f server/.data/app.db && echo "DB_OK" || echo "DB_MISSING"

If the database is missing, tell the user:

Please run Byaan at least once to initialize the database before configuring MCP. You can start it with: cd <PROJECT_ROOT> && make dev

Step 3: Ask User Which Tool to Configure

Ask the user which AI assistant they want to connect Byaan to. The options are:

  1. Claude Code - Uses claude mcp add-json CLI command
  2. Cursor - Edits ~/.cursor/mcp.json config file
  3. Codex CLI - Edits ~/.codex/config.toml config file
  4. All of the above - Configure all three

Step 4: Build the MCP Configuration

The stdio MCP config for Byaan uses these values:

  • command: uv
  • args: ["--directory", "<PROJECT_ROOT>", "run", "python", "-m", "server.mcp.stdio_server"]

Replace <PROJECT_ROOT> with the actual absolute path detected in Step 1.

No environment variables are needed for community/dev mode — the server auto-detects its database and configuration.

Step 5: Install Configuration

For Claude Code

Run the following command (replace <PROJECT_ROOT> with the real path):

claude mcp add-json byaan '{"type":"stdio","command":"uv","args":["--directory","<PROJECT_ROOT>","run","python","-m","server.mcp.stdio_server"]}' --scope user

After running, verify:

claude mcp list

Confirm that byaan appears in the list.

For Cursor

The config file is ~/.cursor/mcp.json. This file may already exist with other MCP servers configured.

  1. Read the existing file (if it exists):
cat ~/.cursor/mcp.json 2>/dev/null || echo "{}"
  1. Merge the Byaan config into the existing JSON. The final file should look like:
{
  "mcpServers": {
    ...existing servers...,
    "byaan": {
      "command": "uv",
      "args": ["--directory", "<PROJECT_ROOT>", "run", "python", "-m", "server.mcp.stdio_server"]
    }
  }
}

Be careful: Do NOT overwrite other existing MCP server entries. Parse the existing JSON, add/update only the byaan key under mcpServers, and write back.

  1. After writing, tell the user:

Restart Cursor to activate the Byaan MCP server. You can use @ask_byaan in Agent chat to query your data.

For Codex CLI

The config file is ~/.codex/config.toml.

  1. Read the existing file:
cat ~/.codex/config.toml 2>/dev/null || echo ""
  1. Check if [mcp_servers.byaan] already exists. If it does, update it. If not, append it.
  2. The section to add/update:
[mcp_servers.byaan]
command = "uv"
args = ["--directory", "<PROJECT_ROOT>", "run", "python", "-m", "server.mcp.stdio_server"]
  1. After writing, tell the user:

Start Codex CLI and run /mcp to verify byaan is connected.

Step 6: Verify the Connection

After configuring, test that the MCP server actually starts:

cd <PROJECT_ROOT> && timeout 10 uv run python -c "from server.mcp.stdio_server import create_stdio_server; print('MCP server module OK')" 2>&1

If this fails, debug the error and help the user fix it before finishing.

Step 7: Summary

Print a summary of what was configured:

Byaan MCP configured for: [list of tools] Project: <PROJECT_ROOT>

The MCP server connects your AI assistant directly to your local databases through Byaan. Restart your editor/tool to activate the connection.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.