Inspiration

At Naptha.ai we have spent a lot of time building developers tools, and one of the biggest problems that we run into is that once users leave our documentation site to evaluate our tool/product/library in their code editor, we have no insight into what they are doing, what's working well, what issues they run into, or where they fall off / abandon our funnel.

I wanted to create a way for us to deliver documentation and support directly into a user's editor, while being able to track what the user is doing, working on, and where they're falling out of our funnel; all the way from our documentation site through their AI editor and into the bottom of our funnel

What it does

This hack is actually a prototype of the product I want to build on top of this. It is a multi-tenant saas app that allows companies to create MCP servers, choose their support channels, and configure auth types.

When users install the MCP server, their unique event tracking ID from mixpanel/google analytics/anything else is included in the MCP server installation URL, so that when the user uses tools we can correlate those events to the same user.

The MCP server can create support tickets based on the user's editor state, context, and what the user is working on; and it does so automatically when the user gets stuck or express frustration, or at the user's request. The MCP server will collect the user's email (if the MCP server is configured to use OAuth we will already have this; if not the agent will ask the user for their email).

When a user's email is collected, it's associated with the original anonymous tracking ID from your upstream event tracking on your docs site, allowing you to identify a user and track their journey through the funnel.

If your product/platform has its' own OAuth server (e.g. Auth0) we can onboard the user directly into your platform through OAuth so that anyone who installs the MCP server now has an account with your platform, enabling editor-based onboarding and activation.

How we built it

I built a next.js app that implements a multi-tenant streamable HTTP server with optional OAuth. Each customer of the platform gets their own vhost for each MCP server, allowing for isolation of OAuth credentials. It uses the SSE and streamable HTTP transports and OAuth.

I didn't have time to finish my contextual retrieval implementation so I used exa.ai for search for the docs tool

Challenges we ran into

  • The MCP ecosystem is very new and lots of tools are rough to work with
  • Working with Auth in MCP is even worse - varying client support is a pain, and most libraries (including the MCP typescript SDK, and better-auth) are BROKEN and I had to fix them to get them to work.
  • Streamable HTTP MCP server multi-tenancy in a single API is not a design pattern people use, so tools don't support it. I had to write a lot of custom code to solve this.
  • Multi-tenancy with OAuth is not something people really do and is only necessary because of quirks of the MCP specification; I had to write lots of custom code to do that too.

Accomplishments that we're proud of

  • building a multi-tenant, streamable HTTP MCP server API with OAuth
  • allowing tracking a user from your documentation site all the way to their editor as they're using docs,
  • allowing users to request support directly from the editor.
  • providing a way to de-anonymize event/analytics tracking IDs by delivering value to AI editor users through MCP

What we learned

More than I ever wanted to knoiw about MCP Auth. MCP auth sucks and needs a lot of work. Multi-tenant OAuth & Streamable HTTP is important but super hard right now

What's next for MCP-Powered Funnels for DevTools Companies

  • more support channels
  • better docs search tool
  • additional tools to provide more user value

Built With

Share this project:

Updates