Skip to content

Commit 352152d

Browse files
authored
Merge pull request #154 from QuantGeekDev/docs/fix-readme-inconsistencies
fix: remove duplicate OAuth section and fix naming inconsistencies in README
2 parents 9ddd03f + 83923bf commit 352152d

1 file changed

Lines changed: 8 additions & 66 deletions

File tree

README.md

Lines changed: 8 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mcp add prompt price-analysis
134134
### Adding a Resource
135135
136136
```bash
137-
# Add a new prompt
137+
# Add a new resource
138138
mcp add resource market-data
139139
```
140140
@@ -199,7 +199,7 @@ mcp add resource market-data
199199
- Use `defineSchema()` during development for immediate feedback
200200
- Build process automatically catches missing descriptions
201201
- Server startup validates all tools before accepting connections
202-
- Use TypeScript's autocomplete with `McpInput<this>` for better DX
202+
- Use TypeScript's autocomplete with `MCPInput<this>` for better DX
203203
204204
## Using with Claude Desktop
205205
@@ -275,7 +275,7 @@ MCP_DEBUG_CONSOLE=true node dist/index.js
275275
MCP Framework uses Zod schemas for defining tool inputs, providing type safety, validation, and automatic documentation:
276276
277277
```typescript
278-
import { MCPTool, McpInput } from "mcp-framework";
278+
import { MCPTool, MCPInput } from "mcp-framework";
279279
import { z } from "zod";
280280
281281
const AddToolSchema = z.object({
@@ -288,7 +288,7 @@ class AddTool extends MCPTool {
288288
description = "Add tool description";
289289
schema = AddToolSchema;
290290
291-
async execute(input: McpInput<this>) {
291+
async execute(input: MCPInput<this>) {
292292
const result = input.a + input.b;
293293
return `Result: ${result}`;
294294
}
@@ -310,7 +310,7 @@ export default AddTool;
310310
The framework supports all Zod features:
311311
312312
```typescript
313-
import { MCPTool, McpInput } from "mcp-framework";
313+
import { MCPTool, MCPInput } from "mcp-framework";
314314
import { z } from "zod";
315315

316316
const AdvancedSchema = z.object({
@@ -346,7 +346,7 @@ class AdvancedTool extends MCPTool {
346346
description = "Tool demonstrating advanced Zod features";
347347
schema = AdvancedSchema;
348348

349-
async execute(input: McpInput<this>) {
349+
async execute(input: MCPInput<this>) {
350350
// TypeScript automatically knows all the types!
351351
const { email, name, website, age, rating, tags, metadata, status, category } = input;
352352

@@ -362,7 +362,7 @@ class AdvancedTool extends MCPTool {
362362
363363
### Automatic Type Inference
364364
365-
The `McpInput<this>` type automatically infers the correct input type from your schema, eliminating the need for manual type definitions:
365+
The `MCPInput<this>` type automatically infers the correct input type from your schema, eliminating the need for manual type definitions:
366366
367367
```typescript
368368
class MyTool extends MCPTool {
@@ -372,7 +372,7 @@ class MyTool extends MCPTool {
372372
tags: z.array(z.string()).describe("User tags")
373373
});
374374

375-
async execute(input: McpInput<this>) {
375+
async execute(input: MCPInput<this>) {
376376
// TypeScript automatically knows:
377377
// input.name is string
378378
// input.age is number | undefined
@@ -567,64 +567,6 @@ const server = new MCPServer({
567567
568568
MCP Framework provides optional authentication for SSE endpoints. You can choose between JWT, API Key, OAuth 2.1 authentication, or implement your own custom authentication provider.
569569
570-
### OAuth 2.1 Authentication
571-
572-
The framework supports OAuth 2.1 authorization with PKCE, implementing the MCP authorization specification. This is ideal for integrating with authorization servers like AWS Cognito, Auth0, Okta, etc.
573-
574-
```typescript
575-
import { MCPServer, OAuthProvider } from "mcp-framework";
576-
577-
const server = new MCPServer({
578-
transport: {
579-
type: "sse",
580-
options: {
581-
auth: {
582-
provider: new OAuthProvider({
583-
// Your authorization server (e.g., Cognito)
584-
authorizationServer: "https://your-domain.auth.us-east-1.amazoncognito.com",
585-
586-
// OAuth client credentials
587-
clientId: process.env.OAUTH_CLIENT_ID,
588-
clientSecret: process.env.OAUTH_CLIENT_SECRET, // Optional for public clients
589-
590-
// The canonical URI of this MCP server
591-
resourceUri: "https://mcp.example.com",
592-
593-
// Required scopes
594-
requiredScopes: ["openid", "profile"],
595-
}),
596-
endpoints: {
597-
sse: false, // SSE endpoint is public
598-
messages: true, // Messages require authentication
599-
}
600-
},
601-
// Handle OAuth callbacks
602-
oauth: {
603-
onCallback: async ({ accessToken, refreshToken }) => {
604-
console.log("User authorized successfully!");
605-
},
606-
onError: async (error) => {
607-
console.error("Authorization failed:", error);
608-
}
609-
}
610-
}
611-
}
612-
});
613-
```
614-
615-
**OAuth Features:**
616-
- 🔐 **OAuth 2.1 with PKCE**: Enhanced security with Proof Key for Code Exchange
617-
- 🌐 **Protected Resource Metadata (RFC 9728)**: Automatic authorization server discovery
618-
- 🎯 **Resource Indicators (RFC 8707)**: Explicit token audience binding
619-
- ✅ **Token Validation**: Support for JWT and opaque tokens
620-
- 🔄 **Token Caching**: Configurable token validation caching
621-
- 🛡️ **Strict Audience Validation**: Prevents token misuse across services
622-
623-
**Quick Links:**
624-
- [OAuth Setup Guide](./OAUTH_GUIDE.md)
625-
- [Cognito Example](./examples/oauth-cognito-example.ts)
626-
- [Custom Validator Example](./examples/oauth-custom-validator.ts)
627-
628570
### JWT Authentication
629571
630572
```typescript

0 commit comments

Comments
 (0)