You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces the integration of Google OAuth2 and Gmail
API into the project. It includes new commands, configurations, and
services to handle OAuth2 authentication and Gmail operations.
### Google OAuth2 and Gmail API Integration:
*
[`cmd/devtest.go`](diffhunk://#diff-529f91fcc39baf08d02b15f11487937a89d21f559557465bc621bbc6c4dff0b6R1-R55):
Added a new command `devtest` to run development tests, including
setting up OAuth2 flow and Gmail API routes.
*
[`cmd/root.go`](diffhunk://#diff-ab967ab1a2f3a1b769106eeb7bfe892ef0e81d1d27811fa15be08e6749feee1fR28):
Registered the new `devtest` command.
*
[`cmd/server.go`](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197R6-R9):
Integrated Google OAuth2 and Gmail API into the server command,
including setting up token storage and Gmail service.
[[1]](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197R6-R9)
[[2]](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197L72-R89)
[[3]](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197L97-R114)
[[4]](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197R124-R125)
[[5]](diffhunk://#diff-ee2560d627cd77f1563972217a33ac39a4bf56fbf30d7f560fbb4199b9f70197L124-R151)
### Configuration Changes:
*
[`internal/config/config.go`](diffhunk://#diff-54c7c1af5fa8d5db4dc49f0e8e80e93ba2b1183ba4d5c9e2e5729e6deae6a3cdR4):
Added new configuration fields for Google service settings.
[[1]](diffhunk://#diff-54c7c1af5fa8d5db4dc49f0e8e80e93ba2b1183ba4d5c9e2e5729e6deae6a3cdR4)
[[2]](diffhunk://#diff-54c7c1af5fa8d5db4dc49f0e8e80e93ba2b1183ba4d5c9e2e5729e6deae6a3cdR18)
### New Google Service Implementation:
*
[`internal/service/google/service.go`](diffhunk://#diff-465e8735f9ba61820c2731d7d716a64c9318b27f32fe4cbe125fa9e267097791R1-R130):
Implemented `GoogleService` to handle OAuth2 flow, including methods for
starting the OAuth process and handling callbacks.
*
[`internal/service/google/storage.go`](diffhunk://#diff-6f6d1b8b0bd0e34e84e35b400f3c4a867047e07b8e33bdde74e964b8c45b6eb8R1-R113):
Added token storage implementations (`InMemoryStorage` and
`FileTokenStorage`) for managing OAuth tokens.
*
[`internal/service/google/errors.go`](diffhunk://#diff-e58dc475377050ab63ecd6e3944a2ba93fa5f82fffc7a6f3ad6c899b1a755a0aR1-R9):
Defined error types for Google service operations.
### Dependency Updates:
*
[`go.mod`](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R31-R38):
Updated dependencies to include necessary Google API and OAuth2
packages.
[[1]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R31-R38)
[[2]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R56-R64)
[[3]](diffhunk://#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R88-R105)
These changes collectively enable the application to authenticate users
via Google OAuth2 and interact with the Gmail API, enhancing its
functionality for email-related operations.
This project is a playground for experimenting with the Model Context Protocol (MCP) and Large Language Models (LLMs).
4
4
5
5
The MCP Kit provides a platform that facilitates interaction with Large Language Models (LLMs) using the Model Context Protocol (MCP).
6
6
It enables AI assistants to interact with external tools and services, extending their capabilities beyond their confined contexts.
7
7
This toolkit offers a standardized way for AI models to communicate with external systems.
8
8
9
-
## Key Features
9
+
**Disclaimer**: This project is a proof-of-concept and is not intended for production use. Feel free to explore, experiment,
10
+
and contribute to the project. For production systems, consider using separate, well-established components mentioned in this project
11
+
and services tailored to your needs. For any questions or feedback, please open an issue or contact the maintainers.
12
+
13
+
## Components
14
+
15
+
### MCP Server
16
+
17
+
The **MCP Server** is a core component implementing the **Model Context Protocol (MCP)** specification. It facilitates structured communication between clients and AI/ML models by adhering to a standardized protocol.
18
+
19
+
#### Key Features:
20
+
-**Protocol Compliance**: Fully compliant with the [MCP specification](https://modelcontextprotocol.io), ensuring interoperability.
21
+
-**Event Streaming**: Supports Server-Sent Events (SSE) for real-time data streaming.
22
+
-**Scalability**: Designed to handle concurrent requests and model interactions.
23
+
24
+
#### Technical Details:
25
+
-**Library**: Built using `github.com/shaharia-lab/goai/mcp` (Go package).
26
+
-**Documentation**: Detailed usage and API references available in the [GoAI Docs](https://github.com/shaharia-lab/goai/tree/main/docs).
The **MCP Client** acts as a configurable intermediary to connect applications to the MCP Server. It abstracts protocol complexities, enabling seamless integration with backend services.
36
+
37
+
#### Key Features:
38
+
-**Protocol Adherence**: Implements the MCP specification for server compatibility.
39
+
-**Configurability**: Supports custom configurations for connection timeouts, retries, and event handling.
40
+
-**Real-Time Support**: Processes SSE streams from the MCP Server and forwards parsed data.
41
+
42
+
#### Technical Details:
43
+
-**Library**: Shares the same `github.com/shaharia-lab/goai/mcp` library as the MCP Server.
44
+
-**Documentation**: See [GoAI Docs](https://github.com/shaharia-lab/goai/tree/main/docs) for client-specific configurations.
45
+
46
+
---
47
+
48
+
### API Server
49
+
50
+
The **API Server** provides an HTTP layer for frontend applications to interact with the MCP ecosystem. It orchestrates communication between the frontend, MCP Client, and external AI services (e.g., LLMs).
51
+
52
+
#### Key Responsibilities:
53
+
1.**Frontend Interface**: Exposes RESTful endpoints for user requests (e.g., prompts, model queries).
54
+
2.**Request Routing**: Forwards incoming requests to the MCP Client and relays responses back.
55
+
3.**LLM Integration**: Processes intermediate data from the MCP Client, invokes LLMs (e.g., for text generation), and formats final responses.
56
+
57
+
### MCP Kit Frontend:
58
+
A dedicated frontend interface for interacting with the API Server, designed for testing and monitoring MCP workflows.
style Server fill:#fc9,stroke:#333,stroke-width:2px
96
+
style LLM fill:#cfc,stroke:#333,stroke-width:2px
97
+
```
10
98
11
-
***API Server**: Provides LLM endpoints to interact with AI models.
12
-
***MCP Client**: Configurable client to connect to the MCP server.
13
-
***Tools**: There are many tools already implemented to access external systems (i.e: filesystem, git, github, postgresql, etc..), and you can easily add more.
14
-
***Interactive Chat Interface**: Provides an interactive chat interface for users to interact with the AI model.
15
-
***Chat History**: Implements in-memory storage for maintaining chat history.
16
-
***LLM Providers**: Supports Anthropic, OpenAI, Amazon Bedrock, Cohere, Meta Llama, Mistral, and DeepSeek models. You can integrate more models easily.
99
+
## Demo
17
100
18
101
<videosrc="https://github.com/user-attachments/assets/81804a29-e896-4f65-a929-05ac6a6aa92a"controlstitle="MCP Kit in action"></video>
19
102
20
-
## Architecture
21
-
22
-
The MCP Kit follows a client-server architecture:
23
-
24
-
1.**Client**: Sends user requests to the MCP server.
25
-
2.**Server**: Processes requests, coordinates with AI models, and manages tool execution.
26
-
27
-
### Request Flow
28
-
29
-
1. The client sends a user query to the MCP server.
30
-
2. The server passes the query to the LLM API.
31
-
3. The LLM determines if tools are needed.
32
-
4. If tools are needed:
33
-
* The LLM sends a request with tool parameters.
34
-
* The MCP server executes the tools.
35
-
* The tool output is returned to the LLM.
36
-
* This loop continues until no more tools are needed.
3. **Create a branch**: Create a new branch for your changes:
222
+
```bash
223
+
git checkout -b feature/your-feature-name
224
+
```
225
+
4. **Make your changes**: Implement your changes, ensure your code is clean and well-documented.
226
+
5. **Test your changes**: Make sure all existing tests pass and write new ones if needed. Run the tests using:
227
+
```bash
228
+
make test
229
+
```
230
+
6. **Submit a pull request**: Push your changes to your forked repository and create a pull request to the `main` branch
231
+
of this repository. Please include a clear description of your changes.
232
+
233
+
We recommend reading the [Conventional Commits](https://www.conventionalcommits.org/) specification to properly format
234
+
your commit messages.
235
+
236
+
### Code of Conduct
237
+
238
+
Please note that by contributing to this project, you agree to adhere to our [Code of Conduct](./CODE_OF_CONDUCT.md).
239
+
240
+
## License
241
+
242
+
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details. Each component may have its own license, so please check the respective repositories/libraries for more information.
0 commit comments