Skip to content

Conversation

@theletterf
Copy link
Contributor

This PR adds crosslink checking tools to the MCP server added in #2368

Changes

  • src/Elastic.Documentation.Mcp/LinkTools.cs — Cross-link tools implementation.

Available tools

Tool Description
ResolveCrossLink Resolves a cross-link (like docs-content://get-started/intro.md) to its target URL and returns available anchors.
ListRepositories Lists all repositories available in the cross-link index with their metadata.
GetRepositoryLinks Gets all pages and their anchors published by a specific repository.
FindCrossLinks Finds all cross-links between repositories. Can filter by source or target repository.
ValidateCrossLinks Validates cross-links to a repository and reports any broken links.

Other changes

  • Added ModelContextProtocol and Microsoft.Extensions.Hosting packages to Directory.Packages.props.
  • Added new project to docs-builder.slnx.
  • Added documentation at docs/mcp/index.md.

Testing locally in Cursor

  1. Build the MCP project:

    dotnet build src/Elastic.Documentation.Mcp/Elastic.Documentation.Mcp.csproj
  2. Create .cursor/mcp.json in your workspace (or globally in ~/.cursor/mcp.json):

    {
      "mcpServers": {
        "docs-builder": {
          "command": "dotnet",
          "args": [
            "run",
            "--project",
            "/path/to/docs-builder/src/Elastic.Documentation.Mcp/Elastic.Documentation.Mcp.csproj"
          ]
        }
      }
    }
  3. Restart Cursor or reload the window.

  4. Open Cursor chat in Agent mode and verify the tools are available. You should see ResolveCrossLink, ListRepositories, GetRepositoryLinks, FindCrossLinks, and ValidateCrossLinks in the tools list.

  5. Test by asking the agent to use the tools:

    • "List all repositories in the cross-link index"
    • "Resolve the cross-link elasticsearch://reference/query-languages/querydsl.md"
    • "Find cross-links from docs-content to elasticsearch"
    • "Validate cross-links to the kibana repository"

@theletterf theletterf requested review from a team as code owners December 15, 2025 16:07
@theletterf theletterf requested a review from reakaleek December 15, 2025 16:07
@theletterf theletterf self-assigned this Dec 15, 2025
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🔍 Preview links for changed docs

@elastic elastic deleted a comment from github-actions bot Dec 15, 2025
@theletterf
Copy link
Contributor Author

@Mpdreamz @reakaleek Merged #2376 — seems to work pretty well!
Screenshot 2025-12-17 at 10 48 05
Screenshot 2025-12-17 at 10 48 10

theletterf and others added 2 commits December 17, 2025 10:54
* Use Json SerializerContext to make it AOT compatible

* Add missing file
@theletterf
Copy link
Contributor Author

AOT compatible serializer works well!

image

Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One implementation feedback, not blocking I can follow up with that if unclear.

@theletterf theletterf marked this pull request as draft December 17, 2025 15:50
@theletterf theletterf marked this pull request as ready for review December 18, 2025 11:02
@theletterf theletterf merged commit 14bb01f into main Dec 18, 2025
29 checks passed
@theletterf theletterf deleted the feature/mcp-link-tools branch December 18, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants