leanmcp 0.3.4 → 0.3.6-alpha.6.6dae082
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
<a href="https://x.com/LeanMcp">
|
|
28
28
|
<img src="https://img.shields.io/badge/@LeanMCP-f5f5f5?logo=x&logoColor=000000" />
|
|
29
29
|
</a>
|
|
30
|
+
<a href="https://leanmcp.com/">
|
|
31
|
+
<img src="https://img.shields.io/badge/Website-leanmcp-0A66C2?" />
|
|
32
|
+
</a>
|
|
33
|
+
<a href="https://deepwiki.com/LeanMCP/leanmcp-sdk"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
30
34
|
</p>
|
|
31
35
|
|
|
32
36
|
## Installation
|
|
@@ -36,6 +40,7 @@ npm install leanmcp
|
|
|
36
40
|
```
|
|
37
41
|
|
|
38
42
|
This meta-package includes all LeanMCP packages:
|
|
43
|
+
|
|
39
44
|
- `@leanmcp/core` — Core decorators (`@Tool`, `@Prompt`, `@Resource`) and HTTP server
|
|
40
45
|
- `@leanmcp/auth` — Authentication with Cognito, Clerk, Auth0, LeanMCP providers
|
|
41
46
|
- `@leanmcp/ui` — MCP-native React components, hooks, and `@UIApp`/`@GPTApp` decorators
|
|
@@ -61,15 +66,15 @@ import { Tool, SchemaConstraint } from 'leanmcp';
|
|
|
61
66
|
class GreetInput {
|
|
62
67
|
@SchemaConstraint({
|
|
63
68
|
description: 'Name to greet',
|
|
64
|
-
minLength: 1
|
|
69
|
+
minLength: 1,
|
|
65
70
|
})
|
|
66
71
|
name!: string;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
export class GreetingService {
|
|
70
|
-
@Tool({
|
|
75
|
+
@Tool({
|
|
71
76
|
description: 'Greet someone',
|
|
72
|
-
inputClass: GreetInput
|
|
77
|
+
inputClass: GreetInput,
|
|
73
78
|
})
|
|
74
79
|
async greet(args: GreetInput) {
|
|
75
80
|
return { message: `Hello, ${args.name}!` };
|
|
@@ -84,6 +89,7 @@ npm start
|
|
|
84
89
|
```
|
|
85
90
|
|
|
86
91
|
Your MCP server starts on `http://localhost:8080` with:
|
|
92
|
+
|
|
87
93
|
- HTTP endpoint: `http://localhost:8080/mcp`
|
|
88
94
|
- Health check: `http://localhost:8080/health`
|
|
89
95
|
|
|
@@ -108,11 +114,11 @@ import { createHTTPServer, Tool } from 'leanmcp';
|
|
|
108
114
|
|
|
109
115
|
// Services are automatically discovered from ./mcp directory
|
|
110
116
|
await createHTTPServer({
|
|
111
|
-
name:
|
|
112
|
-
version:
|
|
117
|
+
name: 'my-mcp-server',
|
|
118
|
+
version: '1.0.0',
|
|
113
119
|
port: 8080,
|
|
114
120
|
cors: true,
|
|
115
|
-
logging: true
|
|
121
|
+
logging: true,
|
|
116
122
|
});
|
|
117
123
|
```
|
|
118
124
|
|
|
@@ -124,7 +130,7 @@ import { Tool, AuthProvider, Authenticated } from 'leanmcp';
|
|
|
124
130
|
const authProvider = new AuthProvider('cognito', {
|
|
125
131
|
region: process.env.AWS_REGION,
|
|
126
132
|
userPoolId: process.env.COGNITO_USER_POOL_ID,
|
|
127
|
-
clientId: process.env.COGNITO_CLIENT_ID
|
|
133
|
+
clientId: process.env.COGNITO_CLIENT_ID,
|
|
128
134
|
});
|
|
129
135
|
await authProvider.init();
|
|
130
136
|
|
|
@@ -145,7 +151,7 @@ import 'leanmcp/ui/styles.css';
|
|
|
145
151
|
|
|
146
152
|
function App() {
|
|
147
153
|
const transport = new HTTPTransport('http://localhost:8080/mcp');
|
|
148
|
-
|
|
154
|
+
|
|
149
155
|
return (
|
|
150
156
|
<AppProvider transport={transport}>
|
|
151
157
|
<AppShell />
|
|
@@ -183,6 +189,7 @@ npm install @leanmcp/cli # CLI tools
|
|
|
183
189
|
## Documentation
|
|
184
190
|
|
|
185
191
|
For complete documentation, examples, and API reference, visit:
|
|
192
|
+
|
|
186
193
|
- [GitHub Repository](https://github.com/LeanMCP/leanmcp-sdk)
|
|
187
194
|
- [Full Documentation](https://github.com/LeanMCP/leanmcp-sdk#readme)
|
|
188
195
|
|
package/package.json
CHANGED