agentleFS
PacificCommunityPacificCommunity/geonode-mcp/.github/copilot-instructions.md

geonode-mcp

Copilot instructions1 starsChanged 8 months agoMITView on GitHub

Use the local project environment and lockfile-managed dependencies: Run the MCP server locally:

  • Reads credentials

The file

We split this copilot-instructions.md into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the local project environment and lockfile-managed dependencies:

    line 5
  2. Distinctive:

    Run the MCP server locally:

    line 30
  3. Very specific:

    Keep new MCP tools in mcp_geonode/server.py and register them with @mcp.tool().

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
copilot-instructions.md

Copilot instructions for mcp-geonode

Build, test, and lint commands

Use the local project environment and lockfile-managed dependencies:

uv sync --extra dev --extra env

Run checks:

# tests (full suite)
uv run pytest -q

# single test
uv run pytest test_env_config.py::test_env_configuration -q

# lint
uv run ruff check .

# formatting check
uv run black --check .

# package build
uv build

Run the MCP server locally:

uv run python main.py
# or
uv run python cli.py

High-level architecture

  • The implementation is centralized in mcp_geonode/server.py.
  • main.py is a thin entrypoint (from mcp_geonode.server import main), and cli.py wraps startup/transport flags but currently falls back to stdio by calling the same main().
  • GeoNodeConfig (Pydantic model) is responsible for reading and validating environment-based configuration (GEONODE_* vars).
  • GeoNodeClient wraps all HTTP access to GeoNode API v2 through one async request() method, including auth header setup and upload-specific header handling.
  • A module-global geonode_client is initialized via _auto_configure_from_env() at import time; all MCP tools call get_client() and fail early if config is missing.
  • Each MCP capability is exposed as @mcp.tool() function in this same module (resources, uploads, users, permissions, upload-status, linked resources).

Key codebase conventions

  • Keep new MCP tools in mcp_geonode/server.py and register them with @mcp.tool().
  • Tool handlers generally return JSON-like dictionaries (Dict[str, Any]) and convert operational failures to {"error": "...message..."} instead of propagating exceptions to the MCP layer.
  • Reuse get_client() + GeoNodeClient.request() for all API calls; endpoints are passed relative to /api/v2.
  • Authentication precedence in GeoNodeClient: bearer token (GEONODE_TOKEN) first, then basic auth (GEONODE_USERNAME/GEONODE_PASSWORD).
  • Environment-first configuration is the active runtime path (.env via optional python-dotenv + GEONODE_* vars). Keep any new config flow consistent with this startup behavior.
  • For shapefile uploads, follow existing sidecar-file behavior (.dbf, .shx, .prj, .sld) when extending upload logic.

Known current baseline (important for future sessions)

  • uv run pytest -q currently errors during collection because test_server.py imports configure_geonode from mcp_geonode.server, but that symbol is not present in the current server module.

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.