Repository navigation
Add bundled MCP server, setup and Extract skills, and Markdown-first search (v1.1.0) - #1
Draft
adarshdigievo wants to merge 3 commits into
Draft
adarshdigievo wants to merge 3 commits into
adarshdigievo wants to merge 3 commits into
Conversation
Bundle SerpApi's hosted MCP server in mcp.json, with the API key as a required plugin variable (SERPAPI_API_KEY) that Cursor sends as a bearer token. The search skill now calls the MCP search tool first and falls back to curl, so a search no longer needs a shell or an exported key. Add a serpapi-setup skill, adapted from serpapi-codex-plugin, for when a key or access is missing. It covers the MCP and curl routes, stores the key for curl in the OS credential store or a private file without it appearing in chat, verifies a real search, and diagnoses failed requests. The search skill's curl commands and its examples now pipe the key to curl on stdin instead of placing it in the URL, and start with -q so a verbose or trace setting in ~/.curlrc cannot print it. The bundled engines/*.json files stay the default source for engine parameters; the MCP resource is read only when a file is missing. test.sh checks the new files, that every mcp.json variable is declared, each skill's frontmatter, and a save-key.sh symlink regression. Bump the plugin version to 1.1.0. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rename the search skill to serpapi-web-search and rebuild it as an adapted port of the serpapi-web-search skill proposed for the serpapi/skills repository. Requests ask for Markdown (output=md) by default and JSON when structured data is needed. The engine table now shows the query input, result key and key fields for common intents; gotchas.md and recipes.md hold the details and worked requests. recipes.md replaces examples.md, and its parameter sets work on both the MCP and curl routes. Add a serpapi-extract skill, adapted from the same source, for reading a known URL as Markdown, listing a site's URLs, and crawling a bounded set of pages through SerpApi's Extract API. The MCP-first order, the curl fallback with the key on stdin, and the bundled engines/*.json schemas are unchanged. The source's CLI route, engine catalog and Python checks are not ported. test.sh checks the new files, that every relative link in the skills and README resolves, and that every engine named in the skills has a bundled schema. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Extract skill said the MCP extract tool's own mode argument only trims JSON. With mode "compact" the tool returns Markdown unless params.output is "json", and a scrape's JSON keeps only markdown and error, so the skill's structured-data example returned Markdown with no error. Say to leave mode out, or use "complete", when JSON is wanted, in the skill and in its request examples. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The plugin now works without a shell or an exported key, guides the user through setup when the key is missing, asks SerpApi for Markdown by default, and can read web pages.
mcp.jsonadds SerpApi's hosted MCP server (https://mcp.serpapi.com/mcp) asserpapi. The key is a required plugin variable,SERPAPI_API_KEY, entered in Cursor's plugin settings and sent as a bearer token.searchbecomesserpapi-web-search, so/searchis now/serpapi-web-search. It calls the MCPsearchtool first and falls back tocurl. It asks for Markdown (output=md) by default and JSON when structured data is needed. Its engine table shows the query input, result key and key fields for common intents.references/gotchas.mdandreferences/recipes.mdreplaceexamples.md.serpapi-extractskill. It reads a known URL as Markdown, lists a site's URLs, or crawls a bounded set of pages through SerpApi's Extract API, on the same two routes.serpapi-setupskill, adapted from serpapi-codex-plugin with only the MCP and curl routes. It runs when a key or access is missing: it stores the key for curl in the OS credential store or a private file without the key appearing in chat, verifies with one real search, and diagnoses failed requests.--data-urlencode 'api_key@-') and starts with-q, so a verbose or trace setting in~/.curlrccan't print it./serpapi-setupand the new skill names,test.shgrows from 11 to 34 checks, and the version is1.1.0.The search and Extract skills are adapted from serpapi/skills#7. Its CLI route, engine catalog and Python checks are not ported; this plugin keeps its bundled
engines/*.jsonschemas as the parameter source.AI disclosure
Changes made by Claude Fable 5.2 (GitHub Copilot Desktop). I made the design decisions; the model wrote the code, docs and tests. Claude Fable 5.2, Gemini 4 Carbon, GPT-6.1 Sol and GPT-6.2 Astra reviewed the first commit over six rounds. Claude Fable 5.2, Gemini 4 Carbon and GPT-6.1 Sol reviewed the search rebuild and the Extract skill over two more rounds; Gemini 4 Carbon timed out in the first of those. Each finding was reproduced or checked against the code before anything was changed. The reviewers read the code only; they could not run the tests or make live calls.
Testing
Run on macOS against commit 14690a2, and by CI on Ubuntu:
bash test.sh: 34 passed, 0 failed, in the working tree, in a fresh clone of this branch, and in CI. Its optional live API check was skipped because no key was set.test.shchecks (relative links resolve; engines named in the skills have a bundled schema) both failed as intended when a linked file and an engine schema were removed in a scratch copy.plugin.jsonis valid against the cursor/plugins manifest schema.mcp.jsonagainst the hosted server: it connects and lists its four tools without a key. An unresolved placeholder returnsInvalid SerpApi API keyand an empty key returnsMissing API key, the two errors the skills handle. Theextracttool returns the same two errors.json_restrictorto keep the response small. Extract returned Markdown inscrape,mapandcrawlmodes, and the structured fields as JSON when the tool's ownmodeis left at its default.verboseandtrace-asciiset in~/.curlrc./search.jsonwithoutput=mdreturnstext/markdown.save-key.shin scratch folders: it saves with directory mode700and file mode600, and refuses an existing key, a symlinked config directory, and a parent directory writable by group or others.Local Cursor test
To be added.
Not tested
save-key.ps1and the PowerShell recipes have never been run.google_ai_overviewfollow-up recipe, which needs a token that no test search returned.