From 43d3adaa550f831737e8ba9257f350676eef3a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Mon, 20 Jul 2026 13:40:28 +0200 Subject: [PATCH] feat(search): add highlights parameter (#323) --- README.md | 3 +++ package.json | 2 +- server.json | 2 +- src/index.ts | 6 ++++++ tests/mcp-smoke.test.mjs | 8 +++++++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bd5fd6c..750df98 100644 --- a/README.md +++ b/README.md @@ -432,6 +432,7 @@ Search the web and optionally extract content from search results. "name": "firecrawl_search", "arguments": { "query": "latest AI research papers 2023", + "highlights": true, "limit": 5, "lang": "en", "country": "us", @@ -444,6 +445,8 @@ Search the web and optionally extract content from search results. } ``` +Set `highlights` to `true` to request query-relevant highlights or `false` to keep the original search snippets. Omit it to use the API's default behavior. + **Returns:** - Array of search results (with optional scraped content), plus an `id` field. Pass that `id` to `firecrawl_search_feedback` after you've used the results to refund 1 credit (search costs 2) and improve search quality. diff --git a/package.json b/package.json index b1f0ca1..ce634e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firecrawl-mcp", - "version": "3.22.3", + "version": "3.22.4", "description": "MCP server for Firecrawl — search, scrape, and interact with the web. Supports both cloud and self-hosted instances. Features include web search, scraping, page interaction, batch processing, and LLM-powered content analysis.", "type": "module", "mcpName": "io.github.firecrawl/firecrawl-mcp-server", diff --git a/server.json b/server.json index 6df5791..6ae0318 100644 --- a/server.json +++ b/server.json @@ -12,7 +12,7 @@ { "registryType": "npm", "identifier": "firecrawl-mcp", - "version": "3.22.3", + "version": "3.22.4", "transport": { "type": "stdio" }, diff --git a/src/index.ts b/src/index.ts index cae24e7..53bc67a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1298,6 +1298,12 @@ The query also supports search operators, that you can use if needed to refine t parameters: z .object({ query: z.string().min(1), + highlights: z + .boolean() + .optional() + .describe( + 'Return query-relevant highlights for each search result. Set to false to keep the original search snippets.' + ), limit: z.number().optional(), tbs: z.string().optional(), filter: z.string().optional(), diff --git a/tests/mcp-smoke.test.mjs b/tests/mcp-smoke.test.mjs index 8d5590e..a9242f9 100644 --- a/tests/mcp-smoke.test.mjs +++ b/tests/mcp-smoke.test.mjs @@ -319,6 +319,11 @@ test('HTTP cloud transport preserves Firecrawl OAuth and well-known routes', asy assert.ok(httpToolNames.includes('firecrawl_scrape')); assert.ok(httpToolNames.includes('firecrawl_search')); assert.ok(httpToolNames.includes('firecrawl_parse')); + const searchTool = toolsMessage.result.tools.find( + (tool) => tool.name === 'firecrawl_search' + ); + assert.equal(searchTool.inputSchema.properties.highlights.type, 'boolean'); + assert.equal('default' in searchTool.inputSchema.properties.highlights, false); assert.equal(stderr.includes('TypeError'), false, stderr); }); @@ -349,7 +354,7 @@ test('HTTP cloud transport calls Firecrawl API with authenticated session', asyn jsonrpc: '2.0', method: 'tools/call', params: { - arguments: { limit: 1, query: 'example domain' }, + arguments: { highlights: false, limit: 1, query: 'example domain' }, name: 'firecrawl_search', }, }), @@ -386,6 +391,7 @@ test('HTTP cloud transport calls Firecrawl API with authenticated session', asyn assert.equal(fakeApi.requests[0].url, '/v2/search'); assert.equal(fakeApi.requests[0].headers.authorization, 'Bearer fc-http-test'); assert.deepEqual(fakeApi.requests[0].body, { + highlights: false, limit: 1, origin: 'mcp-fastmcp', query: 'example domain',