|
/ Documentation /Developers Documentation/ Change the MCP Server Card surerank_pro_mcp_server_card

Change the MCP Server Card surerank_pro_mcp_server_card

Hook: surerank_pro_mcp_server_card

Description: The surerank_pro_mcp_server_card filter changes the MCP server card that SureRank Pro publishes at /.well-known/mcp/server-card.json. The card tells an AI client where the MCP server of the site is and what the server is called. The filter can add a description or change any other part of the card before it is served.

Source: inc/modules/ai-readability/mcp-server-card.php (SureRank Pro)

Usage: Use this filter to change what the card says about the site. The filter receives one value, $card, which is an array, and it must return an array. $card holds serverInfo (with name and version, and description when the site tagline is set), endpoint (the address of the MCP server), and capabilities.

Note:

This filter is available in SureRank Pro, version 1.12.0 or later, and it needs the Publish an MCP Server Card switch to be on. See How to Publish Agent Discovery Files in SureRank.

Example: Add a Description to the Card

If you’re looking to add a short description of the site to the MCP server card, add the code below. Replace the text with your own description.

// Add a short description to the MCP server card.
add_filter( 'surerank_pro_mcp_server_card', 'my_mcp_card_description' );

function my_mcp_card_description( $card ) {
    // $card is the whole card. The description goes inside "serverInfo".
    $card['serverInfo']['description'] = 'SEO tools for the My Company website.';

    // Always return the card, even when nothing was changed.
    return $card;
}

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Expected Outcome

After you add the code, open https://example.com/.well-known/mcp/server-card.json in a browser. Replace example.com with your domain. The card now shows the new description line inside serverInfo.

Notes

  • The card is served only while the MCP server is on and registered. See How to Publish Agent Discovery Files in SureRank for the steps.
  • The same card is served at /.well-known/mcp/server-cards.json and /.well-known/mcp.json, so the change shows at all three addresses.
  • The filter must return an array. Return $card at the end of the function, even when nothing was changed.
  • If the site tagline is set, SureRank already fills description from it. The filter can replace that text.
  • SureRank does not check the values that the filter returns. Check the card in a browser after each change.

Related Docs

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top