Skip to content

Commit

Permalink
feat: major refactor of notion and system prompt services, enhanced t…
Browse files Browse the repository at this point in the history
…esting and validation
  • Loading branch information
Ejb503 committed Jan 16, 2025
1 parent 8717b53 commit 72b7d69
Show file tree
Hide file tree
Showing 39 changed files with 3,621 additions and 2,325 deletions.
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,28 @@

A high-performance Model Context Protocol (MCP) server that seamlessly integrates Notion into your AI workflows. This server enables AI agents to interact with Notion pages and databases through a standardized protocol. This server supports MCP Sampling, which is required to the MCP to create and update Notion pages.

Complicated AI usage is managed by sampling and LLMs.

A compatible MCP client is available [here](https://github.com/Ejb503/multimodal-mcp-client).
A compatible MCP client is available [here](https://github.com/Ejb503/multimodal-mcp-client). Complicated AI usage is managed by sampling and LLMs.

## Server Capabilities

const serverCapabilities: { capabilities: ServerCapabilities } = {
capabilities: {
resources: {
listChanged: true,
},
tools: {},
prompts: {
listChanged: true,
},
sampling: {},
},
};

## Key Features

- **🔄 Real-time Synchronization**

- Bi-directional sync between AI agents and Notion
- Instant updates and notifications
- Conflict resolution handling

- **📝 Comprehensive Content Management**

- Create and update pages with rich text formatting
- Manage databases with complex queries
- Handle comments and discussions
- Search across your Notion workspace

- **🛠 Developer-Friendly**
Expand Down Expand Up @@ -57,7 +62,6 @@ Before using this server, you'll need:
- Required capabilities:
- Read/Update/Insert content
- Database management
- Comment management
- Search functionality

4. **MCP-Compatible Client**
Expand Down
97 changes: 81 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dependencies": {
"@modelcontextprotocol/sdk": "^0.6.0",
"@notionhq/client": "^2.2.15",
"ajv": "^8.17.1",
"dotenv": "^16.4.5"
},
"devDependencies": {
Expand Down Expand Up @@ -63,4 +64,4 @@
"engines": {
"node": ">=18.0.0"
}
}
}
22 changes: 20 additions & 2 deletions src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { jest } from "@jest/globals";
import {
jest,
describe,
it,
expect,
beforeEach,
afterEach,
} from "@jest/globals";
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import type { MockServer } from "../__mocks__/@modelcontextprotocol/sdk";
Expand All @@ -24,7 +31,18 @@ jest.mock("../services/systemprompt-service.js", () => ({
cleanup: jest.fn(),
},
}));
jest.mock("../services/notion-service.js");
jest.mock("../services/notion-service.js", () => ({
NotionService: {
initialize: jest.fn(),
getInstance: jest.fn().mockReturnValue({
searchPages: jest.fn(),
getPage: jest.fn(),
createPage: jest.fn(),
updatePage: jest.fn(),
deletePage: jest.fn(),
}),
},
}));
jest.mock("dotenv", () => ({
config: jest.fn(),
}));
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/mock-objects.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Prompt } from "@modelcontextprotocol/sdk/types.js";
import type { JSONSchema7TypeName } from "json-schema";
import type { SystempromptPromptResponse } from "../types/index.js";
import type { SystempromptPromptResponse } from "../types/systemprompt.js";

// Basic mock with simple string input
export const mockSystemPromptResult: SystempromptPromptResponse = {
Expand Down
Loading

0 comments on commit 72b7d69

Please sign in to comment.