(page_documentation)= # PETSc documentation MCP server or Provides a MCP agent that serves the PETSc documentation ## Purpose The purpose of this MCP agent is to enable the implementation of "higher-level" PETSc MCP agents that correctly access the latest PETSc documentation without wasteful, fragile web searches or slow `grep -r`. See also the `git_grep_petsc_repository` tool provided by PETSc compile-run MCP server. ## Usage The MCP agent may be tested from the command line using ```bash python petsc_documentation_mcp_client.py [--stdio] [--url PETSC_MCP_SERVERS_URL] --get_petsc_manual_pages string ``` or ```bash python petsc_documentation_mcp_client.py [--stdio] [--url PETSC_MCP_SERVERS_URL] --get_petsc_users_manual_section section ``` The client Python file also contains a `PetscDocumentationMCPClient()` class that connects to the server and has a (mirror) method for each tool provided by the server. To start the MCP server locally ```bash PETSC_DIR=xxx PETSC_ARCH=yyy python petsc_documentation_mcp_server.py [--stdio] ```