Public Endpoint

The MCPServer’s public endpoint, /api/v1/mcp/smarter-project/: The Smarter Project’s repositories, documentation and blog.

PublicEndpoint serves the public tools, PUBLIC_TOOL_CLASSES, over the protocol of MCPEndpointBase, and PublicEndpointView serves it, to any MCP client, e.g. an LLMClient whose smarter_project MCPClient connects to it, or Claude Code. Its read-only tools need no authentication. create_issue, comment_on_issue, close_issue and create_pull_request are listed only when the request carries the caller’s GitHub token.

Note

Experimental. The MCPServer was designed and coded by Claude Code (Anthropic’s Claude Opus 5.5), with Lawrence McDaniel as co-author. It is experimental, and will be documented.

smarter.apps.mcpserver.protocol.public.INSTRUCTIONS = "This server reads {subject}, from GitHub: its documentation and its source code. Answer questions about The Smarter Project from what its tools return, rather than from memory, which may be outdated or about another product named Smarter.\n\n- search_documentation finds concepts, features, configuration and how-to guides, in the Sphinx documentation that is published at {docs_url}, and in READMEs.\n- search_code finds how something is implemented, and a class, function, setting or manifest field by name.\n- read_file reads a file that a search returned, to confirm the details before you answer.\n- get_repository_overview and list_files describe a repository's layout.\n- get_manifest_schema returns a resource kind's example manifest and every field of its manifest, from the JSON Schema that the platform validates manifests with. Call it before you write, fix or explain a manifest, and never invent a field that it does not list. validate_manifest checks a manifest with the platform's own validation: call it on every manifest that you write or fix, and fix what it reports, before you give it to the user.\n- search_issues searches the GitHub issues, live: known bugs, feature requests, and whether they are fixed. Call it when a user reports a problem. read_issue reads one issue and its latest comments.{blog}\n\nSearch with specific keywords and identifiers. Some clients allow only one round of tool calls per answer, so make every search that you need at once, in parallel, e.g. search_documentation and search_code together, rather than one after another. Their results include the matching lines, which are usually enough to answer. Cite your sources: link to the published documentation page when a result has one, and otherwise to the GitHub url of the file.{repositories}"

The server’s instructions, which MCP clients add to the LLM’s system prompt.

They tell the LLM to answer from the tools rather than from memory, which tool answers which kind of question, and to make its searches in parallel. PublicEndpoint.instructions() fills in subject, docs_url, repositories and blog.

smarter.apps.mcpserver.protocol.public.PUBLIC_ENDPOINT_NAME = 'smarter-project'

The name of the public endpoint of every repository, in its initialize result and in the logs.

The endpoint of one repository adds its name, e.g. smarter-project-smarter-cli.

class smarter.apps.mcpserver.protocol.public.PublicEndpoint(repository=None, github_token=None)[source]

Bases: MCPEndpointBase

The public endpoint of one repository of The Smarter Project, or of all of them.

The view creates one for each request, with the repository from the url, and the GitHub token from the request’s Authorization: Bearer header. Its tools are the classes of PUBLIC_TOOL_CLASSES that the scope serves.

Parameters:
  • repository (ProjectRepository | None) – The repository, or None for all of them.

  • github_token (SecretStr | None) – The caller’s GitHub token, from the request’s Authorization: Bearer header, or None. The tools that write, e.g. create_issue, are served only with one.

Example usage:

server = PublicEndpoint(get_repository("smarter-cli"))
response = server.handle({"jsonrpc": "2.0", "id": 1, "method": "tools/list"})
__init__(repository=None, github_token=None)[source]

Build the server’s scope, and the tools that it serves.

A tool is served only if serves() says so: a project-wide tool, e.g. search_blog, is left out of the endpoint of one repository, and a tool that writes to GitHub is left out unless the request carries a GitHub token.

Parameters:
  • repository (ProjectRepository | None) – The repository, or None for all of them.

  • github_token (SecretStr | None) – The caller’s GitHub token, or None.

instructions()[source]

Return the server’s instructions, which MCP clients add to the LLM’s system prompt.

They are INSTRUCTIONS, about the server’s one repository, or about all of them, with the list of the repositories and BLOG_INSTRUCTIONS. When the server serves the tools that write to GitHub, ISSUE_INSTRUCTIONS are added, which tell the LLM to call them only with the user’s consent.

Return type:

str

Returns:

The instructions, as plain text.

property name: str

smarter-project, or smarter-project-<repository>, e.g. smarter-project-smarter-cli.

Type:

The server’s name

server_info()[source]

Return the server’s identity, for the initialize result.

The endpoint of one repository takes its title and description from the repository, and the endpoint of every repository describes The Smarter Project.

Return type:

Implementation

Returns:

The server’s name, title, version (the platform’s), description and website.