[PR #2971] [MERGED] fix issue with hardcoded baseURL in withMcpAuth #21478

Closed
opened 2026-04-15 20:23:51 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2971
Author: @lazakrisz
Created: 6/10/2025
Status: Merged
Merged: 7/17/2025
Merged by: @Bekacru

Base: mainHead: fix-mcp-metadata-url


📝 Commits (2)

  • 1581b75 fix issue with hardcoded baseURL in withMcpAuth
  • f39d4ae chore: lint

📊 Changes

1 file changed (+10 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/plugins/mcp/index.ts (+10 -3)

📄 Description

hey,
I came across an issue while integrating the mcp plugin with hono using version 1.2.9. The resource_metadata hardcodes the localhost:3000 host, see the issue at https://github.com/better-auth/better-auth/issues/2703 .

This PR fixes it, although I had to extend the Auth interface with the options property with type of BetterAuthOptions, but I think that should work since, the documentation mentions passing the auth instance in which should have the options property on it. (see docs at https://www.better-auth.com/docs/plugins/mcp#mcp-session-handling)

Let me know if anything else is needed, I'd be happy to adjust! 🙏


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/2971 **Author:** [@lazakrisz](https://github.com/lazakrisz) **Created:** 6/10/2025 **Status:** ✅ Merged **Merged:** 7/17/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix-mcp-metadata-url` --- ### 📝 Commits (2) - [`1581b75`](https://github.com/better-auth/better-auth/commit/1581b7563fcbca0ec1ff82638539b212ba5fdce6) fix issue with hardcoded baseURL in withMcpAuth - [`f39d4ae`](https://github.com/better-auth/better-auth/commit/f39d4aeb9e3615cf72454504e0fb44ecb053a22a) chore: lint ### 📊 Changes **1 file changed** (+10 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+10 -3) </details> ### 📄 Description hey, I came across an issue while integrating the mcp plugin with hono using version 1.2.9. The resource_metadata hardcodes the localhost:3000 host, see the issue at https://github.com/better-auth/better-auth/issues/2703 . This PR fixes it, although I had to extend the Auth interface with the `options` property with type of `BetterAuthOptions`, but I think that should work since, the documentation mentions passing the `auth` instance in which should have the options property on it. (see docs at https://www.better-auth.com/docs/plugins/mcp#mcp-session-handling) Let me know if anything else is needed, I'd be happy to adjust! 🙏 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 20:23:51 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#21478