• Resolved utsavmadaan823

    (@utsavmadaan823)


    Hi,

    First up thanks for this great plugin.

    I have a specific usecase for which i wanted to use your plugin. In my usecase, i needed a shareable custom-gpt through which people can talk & post directly to my website anonymously, no user account on the website or oauth needed.

    Just a simple sharable custom-gpt link which people can use to interact with website.

    1st problem – custom gpt supports only openapi not directly mcp, so i quickly spinup a plugin which becomes the translation layer between custom gpt & your plugin that is working great.

    2nd problem – descriptions generated from mcp server exceeds the length limit imposed by custom gpt (action), which preventing it to be used with custom gpt, for this also i will quickly ask ai to hook & map required long descriptions to shortened descriotions.

    You please see if you want to adjust your plugin for this usecase. For the time being, AI is available for me to rescue.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • easymcpaisupport1

    (@easymcpaisupport1)

    Hi @utsavmadaan823 ,

    Hi @utsavmadaan823,

    Sorry for the slow reply. Short answers to all three of your points, then
    the setup that actually works.

    1. OPENAPI VS MCP — WE DO NOT SOLVE THIS, AND YOUR SHIM IS RIGHT

    Our plugin exposes a single JSON-RPC endpoint. Every tool is the same URL
    and the same HTTP method, so the Actions builder has no way to tell one
    tool from another. Your translation layer is not a workaround for
    something we forgot — it is the only thing that can work, and it will keep
    working. Nothing below removes it.

    Your stack stays as it is:

    Custom GPT -> your translation layer (yours) -> Easy MCP AI (ours, MCP)

    1. THE DESCRIPTION LIMIT IS OPENAI’S, AND IT IS HARD

    https://developers.openai.com/api/docs/actions/production

    “300 characters max for each API endpoint description/summary field”
    “700 characters max for each API parameter description field”

    Of our 244 tools, 184 exceed 300 characters (median 404, longest 1546).
    We do not expose a filter for tool descriptions, so the shortening has to
    happen in your layer.

    You can make that job tiny, though. tools/list is filtered per token, so
    create a token under Easy MCP AI -> API Tokens with only the tools this
    GPT needs ticked, and the server returns only those — three or four
    descriptions to hand-write instead of 244. I verified this on a clean
    install: a token with only wp_create_post ticked returns exactly one tool,
    and calling anything else is refused with “Token does not have permission
    to use this tool”.

    For the few that remain:

    function my_gpt_clip( $text, $limit ) {
    $text = trim( preg_replace( ‘/\s+/’, ‘ ‘, wp_strip_all_tags( (string) $text ) ) );
    if ( mb_strlen( $text ) <= $limit ) { return $text; } $cut = mb_substr( $text, 0, $limit – 1 ); $space = mb_strrpos( $cut, ‘ ‘ ); if ( false !== $space && $space > 40 ) {
    $cut = mb_substr( $cut, 0, $space );
    }
    return rtrim( $cut, ” \t,.;:-(” ) . ‘.’;
    }

    function my_gpt_adapt_tool( array $tool ) {
    // Hand-written short descriptions for the few tools you expose.
    $short = array(
    ‘wp_create_post’ => ‘Create a new post from the visitor\’s message. Requires title; content is optional HTML. Saved as a draft for review.’,
    );

    $name = isset( $tool['name'] ) ? $tool['name'] : '';
    $desc = isset( $short[ $name ] )
        ? $short[ $name ]
        : ( isset( $tool['description'] ) ? $tool['description'] : '' );
    
    // An empty description makes ChatGPT pick the wrong tool, so never ship one.
    $tool['description'] = my_gpt_clip( '' !== trim( $desc ) ? $desc : str_replace( '_', ' ', $name ), 300 );
    
    if ( ! empty( $tool['inputSchema']['properties'] ) && is_array( $tool['inputSchema']['properties'] ) ) {
        foreach ( $tool['inputSchema']['properties'] as $prop => $spec ) {
            if ( isset( $spec['description'] ) ) {
                $tool['inputSchema']['properties'][ $prop ]['description'] = my_gpt_clip( $spec['description'], 700 );
            }
        }
    }
    
    return $tool;

    }

    Run each tools/list entry through my_gpt_adapt_tool() before turning it
    into an OpenAPI operation; our definitions use name, description and
    inputSchema, so it maps straight across. Against the real wp_create_post
    definition: 881 characters in, 116 out with the override, 284 out on the
    truncation fallback. Prefer the overrides — truncation cuts mid-sentence,
    and ChatGPT picks tools based on that text.

    1. YOUR ANONYMOUS USE CASE ALREADY WORKS — NO OAUTH, NO PLUGIN CHANGE

    This is the part you may not know about. I set it up on a clean install
    and tested it end to end before writing it down:

    a. Create a WordPress user with the Author role. The token screen only
    offers users who can publish_posts, so Author is the lowest available
    and Contributor will not appear. The easy_mcp_ai_oauth_min_capability
    filter changes that if you need something weaker.

    b. Create a token bound to that user, ticking only wp_create_post plus
    any reads you want. Every post from the shared GPT is attributed to
    that one user. Your visitors need no account and never see a login.

    c. Turn on Settings -> Force Draft on Create. I called wp_create_post
    with status=publish and it came back as a draft, confirmed in the
    database. Nothing goes live unreviewed — with a public GPT link,
    treat this as required, not optional.

    d. Tokens take an optional expiry date, the rate limit is counted per
    token (default 60 requests a minute), and successful tool calls are
    recorded in the audit log. Refused calls are not logged.

    1. WILL WE ADJUST THE PLUGIN?

    Two separate things, and I will be straight about both:

    • A short description per tool, alongside the full one. Worth doing, it
      is on the list, but I am not promising a release.
    • A native OpenAPI bridge (per-tool routes plus a generated schema).
      That is a real feature rather than a quick fix, and it is not planned
      right now. Better you hear that than wait for it.

    Neither blocks you. Everything in point 3 works on the current release.

    1. ONE THING WORTH KNOWING BEFORE YOU INVEST MORE

    ChatGPT can now talk to an MCP server directly through Developer mode, and
    our endpoint works there as it stands. It does not replace what you built:
    it is configured per account rather than published as a shareable link.

    Custom GPTs and MCP are still separate systems in OpenAI’s docs, so your
    layer stays the right call for a shareable, anonymous, write-capable GPT.

    Thanks for the write-up. Your translation layer is sensible engineering
    and should keep working regardless of what we do.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.