Connect login, agent-first
Register and manage your OAuth app from an MCP client — with one token, or a browser login and no token at all — then wire login with an OIDC + PKCE SDK adapter.
Machine-readable: /llms.txt ·/llms-full.txt
Connect with a personal access token
Mint a PAT at account.modfolio.io/developers/tokens (scopes clients:read, clients:write), then add the server to your MCP client config:
{
"mcpServers": {
"modfolio-connect": {
"type": "http",
"url": "https://login.modfolio.io/mcp",
"headers": { "Authorization": "Bearer mfp_YOUR_TOKEN" }
}
}
}Call whoami to confirm the token, then register_app. Keep the PAT in config or an env var — never in source, logs, or chat.
Connect with a browser login
OAuth-capable MCP clients need only the URL https://login.modfolio.io/mcp. An unauthenticated request returns 401 with a WWW-Authenticate challenge; the client then discovers the protected-resource metadata (RFC 9728), the authorization server (RFC 8414), self-registers (Dynamic Client Registration, RFC 7591) and runs OAuth 2.1 + PKCE. You log in and consent in the browser. Tokens are audience-bound to the MCP resource (RFC 8707).
What the MCP server exposes
register_app(name, redirect_uris[])list_apps()get_app(client_id)rename_app(client_id, name)delete_app(client_id)add_redirect_uri(client_id, uri)remove_redirect_uri(client_id, uri)whoami()get_scope_catalog()
Or register over plain HTTP
curl -s -X POST https://login.modfolio.io/api/v1/clients \
-H "Authorization: Bearer $MODFOLIO_PAT" \
-H "content-type: application/json" \
-d '{"name":"My App","redirect_uris":["https://myapp.com/auth/callback"]}'Wire login in your app
Install @modfolio/connect-sdk from public npm (no token, no .npmrc) and use a framework adapter — SvelteKit, Astro, Next.js, Nuxt, SolidStart, Qwik, Hono:
// src/lib/server/auth.ts
import { createSvelteKitAuth } from "@modfolio/connect-sdk/sveltekit";
export const auth = createSvelteKitAuth({ clientId: "your-client-id" });
// src/hooks.server.ts
export const handle = auth.handle;Discovery & reference
MCP server
Streamable HTTP. Bearer PAT or browser OAuth. Register & manage apps.
Protected resource
MCP resource metadata — the 401 WWW-Authenticate target.
Authorization server
OAuth metadata incl. registration_endpoint (DCR), PKCE, grants.
OpenID configuration
Issuer, endpoints, scopes, ES256, S256 PKCE.
Signing keys
ES256 public keys for verifying access tokens.
Machine-readable guide
The full integration guide as plain text for AI agents.