← Pablo Murad

Mycroft, the Holmes brother who lives in my search bar

I ignored the Mycroft Project for years. Today I ran into it again while looking at Disroot's services and came away with GitHub and Reddit in my address bar. How to use it, what a search plugin is, and how it sits next to Kagi's bangs and lenses.

Sidney Paget's 1893 ink illustration of Mycroft Holmes for The Strand Magazine.
Mycroft Holmes, drawn by Sidney Paget for The Strand Magazine, 1893.
Contents

I first saw the Mycroft Project many, many years ago and didn't give it a second of my attention. A page full of search plugins. So what.

Today I bumped into it again, by accident, while I was going through the services on disroot.org.1 This time it caught my eye, and a few minutes later GitHub and Reddit were sitting in my address bar.

So this is a small manual: what the site is, how to use it, and how it fits next to Kagi, the search engine I use every day.

A brother smarter than Sherlock #

The Mycroft Project is a library of search plugins. The home page says there are over 28 thousand of them, in two formats, OpenSearch and Sherlock. A search plugin teaches the browser how to search one specific site, so the words go from the address bar straight into GitHub, Reddit, IMDb, a dictionary, a library catalog, or whatever else somebody bothered to write a plugin for.

The name is a good joke for anyone who knows their Conan Doyle. The project grew out of plugins for Sherlock, the search tool Apple shipped with the Mac in the late nineties,2 and Mycroft is Sherlock's older brother. In "The Greek Interpreter", Sherlock admits Mycroft reasons better than he does. He just won't get out of his armchair to prove it.3 A site that does the legwork of searching, named after the detective who never wanted to walk anywhere. Fair enough.

The footer reads 2000-2026, and the hosting comes from the Open Source Lab at Oregon State University.

The Mycroft Project home page: a dark red header with the site name and a search box, a sidebar of links, and orange-headed sections for finding plugins, the ten popular domains from Google to IMDb, and short explanations of what the project and a search plugin are.
The Mycroft Project's front page.

What a search plugin actually is #

Behind every OpenSearch plugin there's a tiny XML file. The line that matters is a URL template with a hole where the search terms go:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>GitHub</ShortName>
<Url type="text/html" template="https://github.com/search?q={searchTerms}"/>
</OpenSearchDescription>

Firefox reads that, swaps {searchTerms} for whatever I typed and opens the page. That's the whole trick.4 Mycroft is a giant drawer of these little files, sorted by category and language, with a status on each one saying whether it still works.

How to use it #

Search for the site #

The box on the home page takes the site's name. "github" gave me 24 plugins, grouped by category: programming, software, education, games and a few strays.

Mycroft Project search results for github: 24 plugins listed under nine categories, each line with small format and status icons, the plugin name, the site and the author. Three entries are highlighted in yellow, and a key at the bottom explains the icons.
Searching for github. A tick means the plugin should be working, and the yellow ones are the most downloaded.

Read the little icons #

Each result shows its format, a status (working, untested or probably broken), a flag for the language and the author's name. Most plugins are marked untested, which only means nobody verified them lately. For GitHub, two were marked as working: "GitHub - Code" and a plain "GitHub". The yellow highlight marks the most downloaded results, and the Top 100 page lists the most downloaded plugins on the whole site.

Click the name #

That opens an install page, and the page is upfront about it: right now this only works in Firefox.5

The Mycroft Project install page. It reads: Install plugin. This page allows you to install the selected plugin. Currently only working for Firefox. Click on the magnifying glass icon in the Firefox search bar or the Page Actions ... in the location bar. There will be an option to 'Add GitHub - Code' or 'Add Search Engine'.
The install page for GitHub - Code.

Add it to Firefox #

Open the "..." Page actions menu in the address bar (or the magnifying glass, for anyone who still keeps the separate search bar) and pick "Add search engine". The plugin's name can show up there too, as "Add GitHub - Code".

Give it a keyword #

This is the step that saves the typing. In Settings, open Search, scroll down to Search Shortcuts, double-click the Keyword column next to the new engine and type something short. From then on, the keyword, a space and the search terms go straight to the site:

gh magic-wormhole
rd selfhosted backups

No menu, no search page in between. Firefox opens GitHub's or Reddit's own results.

For a site with no plugin yet, the Developers menu has a form to create one and submit it to the collection.

Kagi does something like this #

I use Kagi every day. I pay for it, I love it, and I'm not leaving. Kagi has two features that look like what Mycroft does, and they're easy to confuse.

Bangs send the search somewhere else #

A bang is a shortcut that starts with an exclamation mark and takes the query to another site. Kagi's help page lists the classics: !w for Wikipedia, !yt for YouTube, !r for Reddit, !imd for IMDb. The bang can go at the start or at the end, with or without a space:

!w mycroft holmes
mycroft holmes !w
mycroft holmes w!

Kagi has a few other kinds. Regional bangs pick a country (!de for Germany, !nl for the Netherlands). Time bangs cut the results to the last day, week, month or year (!24, !week, !month, !year). A lonely ! jumps straight to the first result. Custom bangs live in the settings and take a URL template, where $1 is the first word of the query. Quick bangs work without the exclamation mark, up to 50 of them. And a bang that goes to an outside site doesn't count toward Kagi's usage or billing.6

Lenses keep the search inside Kagi #

A lens keeps the search in Kagi and narrows what comes back. The lenses page lists the ones ready to use: Forums, Programming, News 360, Fediverse Forums, Usenet/Archive, Academic (.edu sites) and PDFs. Small Web, Recipes and Cyber Security exist too, but have to be switched on first in the Lenses settings.

A custom lens takes up to 10 sites to include, 10 to exclude, 5 keywords in, 5 keywords out, a region, a file type and a date range. It can be shared through a link, and it can get its own bang in its settings, so typing that bang applies the lens right away. One limit: lenses don't work with image or video search yet.

Side by side:

BangLens
Results come fromThe other siteKagi
What it doesSends the query awayFilters Kagi's results
Good forSearching Reddit or IMDb directlyOnly forums, only PDFs, only a handful of chosen sites
How to trigger it!r at the start or the endThe lens menu, or the lens's own bang
Leaves KagiYesNo
Source
| | Bang | Lens |
|-+------+------|
| Results come from | The other site | Kagi |
| What it does | Sends the query away | Filters Kagi's results |
| Good for | Searching Reddit or IMDb directly | Only forums, only PDFs, only a handful of chosen sites |
| How to trigger it | !r at the start or the end | The lens menu, or the lens's own bang |
| Leaves Kagi | Yes | No |

And the path each one takes, with a Firefox keyword at the bottom for comparison:

paths q1 mycroft holmes !w k1 Kagi q1->k1 q2 tui file manager + Forums lens k2 Kagi q2->k2 q3 gh magic-wormhole (Firefox keyword) g GitHub results q3->g direct w Wikipedia results k1->w redirect f Kagi results, forums only k2->f filter
Source
digraph paths {
  graph [rankdir=LR, fontname="Helvetica", nodesep=0.35, ranksep=0.45];
  node [shape=box, style="rounded", fontname="Helvetica", fontsize=11, margin="0.3,0.1"];
  edge [color="#8a8a8a", arrowsize=0.6, fontname="Helvetica", fontsize=10];
  q1 [label="mycroft holmes !w"];
  q2 [label="tui file manager\n+ Forums lens"];
  q3 [label="gh magic-wormhole\n(Firefox keyword)"];
  k1 [label="Kagi"];
  k2 [label="Kagi"];
  w [label="Wikipedia results"];
  f [label="Kagi results,\nforums only"];
  g [label="GitHub results"];
  q1 -> k1; k1 -> w [label="redirect"];
  q2 -> k2; k2 -> f [label="filter"];
  q3 -> g [label="direct"];
}

So why bother with Mycroft? #

Kagi already has !r, so it's a fair question. A few reasons:

  • The plugin lives in the browser. It works the same no matter which engine is the default, and it keeps working on a machine that isn't logged in to Kagi.
  • The query goes straight to the site. A bang passes through Kagi first and then gets redirected, and a Firefox keyword skips that hop.
  • With 28 thousand plugins, there's one for sites so small that nobody ever made a bang for them.

Mycroft doesn't replace Kagi, and Kagi doesn't replace Mycroft. The two live together without a fight: the bang from inside Kagi, the keyword when the destination is already known.

Which is what I wanted to say with all of this. There's no such thing as too many tools. A few tiny search shortcuts in the browser cost nothing.

Mycroft spent his days in an armchair at the Diogenes Club, and these plugins do the same: they sit quietly in the address bar until someone calls them.

Notes

  1. Disroot runs its own search engine, a SearXNG instance. It's a metasearch engine: it asks other engines and hands back their results together, and Disroot says it keeps no record of the IP addresses that use it. ↩

  2. Sherlock arrived with Mac OS 8.5 in 1998. Years later, when Apple built the ideas of a third-party app called Watson into Sherlock 3, Mac developers coined a verb for it. When Apple ships your app's feature in the system, your app got "Sherlocked". ↩

  3. Mycroft first shows up in "The Adventure of the Greek Interpreter", published in The Strand Magazine in September 1893. His club, the Diogenes, has a rule that no member may talk to another. ↩

  4. OpenSearch came from A9, Amazon's search company, in 2005. That's why the namespace in the XML still points to a9.com, and why the OpenSearch badge on Mycroft is an image called a9.png. ↩

  5. Firefox used to install these with one click, through an old JavaScript call named window.external.AddSearchProvider. Mozilla dropped it years ago, and the site moved to the install page plus the browser's own menu. There was an extension to work around the change, and its page now says it isn't needed anymore. ↩

  6. Kagi's bang list is open source, and anyone can suggest a new one. A custom bang made in the settings also overrides a global one with the same name. ↩