Content
# MCP Server
Based on [Model Context Protocol (MCP)](https://modelcontextprotocol.io), this is an integration service for泛微OA Ecology E9.
## Quick Start
### 1. Installation
```bash
# Download the project
git clone https://github.com/tanzhangjia/weaver-ecology-mcp.git
cd weaver-ecology-mcp
# Install dependencies
npm install
# Build
npm run build
```
### 2. OA Side Preparation
Perform the following operations in the泛微OA system:
**a. Configure Interface Whitelist**
Edit `ecology/WEB-INF/prop/weaver_session_filter.properties`, and add the following content to `unchecksessionurl=`:
```
/api/ec/dev/auth/regist;/api/ec/dev/auth/applytoken;
```
**b. Insert License**
```sql
INSERT INTO ECOLOGY_BIZ_EC(ID, APPID, NAME)
VALUES('123456', 'your APPID', 'MCP Service');
```
### 3. MCP Client Configuration
#### Claude Desktop
Edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"weaver-ecology": {
"command": "node",
"args": ["/path/to/weaver-ecology-mcp/dist/index.js"],
"env": {
"WEAVER_BASE_URL": "http://192.168.1.100",
"WEAVER_APP_ID": "EEAA5436-7577-4BE0-8C6C-89E9D88805EA",
"WEAVER_RSA_PRIVATE_KEY": "-----BEGIN RSA PRIVATE KEY-----...-----END RSA PRIVATE KEY-----",
"WEAVER_RSA_PUBLIC_KEY": "-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----"
}
}
}
}
```
#### Cursor
In Cursor's MCP configuration, fill in the Command as:
```
node /path/to/weaver-ecology-mcp/dist/index.js
```
## Authentication Process
The MCP service automatically handles Token authentication for泛微OA:
```
┌──────────┐ ┌──────────────┐ ┌──────────┐
│ Register │───▶│ POST /regist │───▶│ Return │
│ (APPID + │ │ │ │ secrit │
│ public key) │ │ │ │ + spk │
└──────────┘ └──────────────┘ └──────────┘
│
┌──────────┐ ┌──────────────┐ ┌──────────┐
│ Get Token│───▶│POST /apply- │───▶│ Return │
│ (spk encrypt│ │ token │ │ token │
│ secrit) │ │ │ │ │
└──────────┘ └──────────────┘ └──────────┘
│
┌──────────┐ ┌──────────────┐ ┌──────────┐
│ Call API │───▶│ Business API │───▶│ Return │
│ (token + │ │ │ │ data │
│ userid) │ │ │ │ │
└──────────┘ └──────────────┘ └──────────┘
```
- Token is valid for 30 minutes by default, and the system automatically refreshes it 5 minutes before expiration
- RSA key pair is automatically generated (can also be manually specified)
- userid is transmitted using system public key RSA encryption
## Available Tools
### Authentication Management
| Tool | Description |
|------|------|
| `weaver_auth_register` | Register license with OA (automatically managed by the system, usually no need for manual invocation) |
| `weaver_auth_get_token` | Get/refresh access Token (automatically managed by the system) |
### Workflow
| Tool | Description |
|------|------|
| `weaver_workflow_list` | Query process template list |
| `weaver_workflow_create` | Initiate process request (create approval sheet) |
| `weaver_workflow_query` | Query process status and approval progress |
| `weaver_workflow_approve` | Approve/reject process |
### Organization Structure
| Tool | Description |
|------|------|
| `weaver_hrm_user_query` | Query personnel information (ID/login name/name) |
| `weaver_hrm_dept_query` | Query department information |
### Attachment & General
| Tool | Description |
|------|------|
| `weaver_doc_upload` | Upload attachment file to OA |
| `weaver_api_request` | 🔧 General interface call (use when built-in tools do not cover) |
## Environment Variables
| Variable | Required | Description |
|------|------|------|
| `WEAVER_BASE_URL` | Yes | OA server address, e.g., `http://192.168.1.100` |
| `WEAVER_APP_ID` | Yes | License number |
| `WEAVER_RSA_PRIVATE_KEY` | No | RSA private key PEM (automatically generated if not provided) |
| `WEAVER_RSA_PUBLIC_KEY` | No | RSA public key PEM (automatically generated if not provided) |
## Frequently Asked Questions
### Registration Failure: "APPID not found"
→ Confirm that the corresponding APPID is inserted in the `ECOLOGY_BIZ_EC` table
### Token Expiration/Timeout
→ The system will automatically refresh; if continuous failure, please check if the OA server time is synchronized
### Interface Returns "Authentication Information Error"
→ Confirm that the RSA public key/private key is consistent, and check the OA server version
## License
Apache License 2.0
```
Copyright 2025 tanzhangjia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
Connection Info
You Might Also Like
vault
MCP prompt-injection scanning proxy — runtime security for MCP tool responses
wechat-local-mcp
WeChat local chat history MCP server for macOS agents. Read messages,...
wechat-cli
WeChat/微信 local chat history MCP server for macOS agents. Read messages,...
coros-mcp
MCP server that fetches sleep, HRV, and daily metrics from the unofficial...
caido-mcp-server
Enhanced MCP server for Caido with multiple tools
memo
Memo MCP -- save and restore conversation across agents