-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy path.1mcprc.example
More file actions
109 lines (89 loc) · 3.54 KB
/
.1mcprc.example
File metadata and controls
109 lines (89 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{
"$schema": "https://docs.1mcp.app/schemas/v1.0.0/project-config.json",
// Project-level configuration for 1MCP proxy command
// Place this file in your project directory to set default connection settings
// Priority: preset > filter > tags (only one will be used)
// Option 1: Use a preset configuration (highest priority)
"preset": "my-preset",
// Option 2: Use a filter expression (medium priority)
// "filter": "web AND database",
// Option 3: Use simple tags (lowest priority)
// "tags": ["web", "api", "database"],
// "tags": "web,api,database" // String format also supported
// Enable context-aware proxy mode (NEW!)
"context": {
// Project identifier for template substitution
"projectId": "my-awesome-app",
// Environment for template substitution
"environment": "development",
// Team or organization identifier
"team": "platform",
// Custom context variables available in templates
"custom": {
"apiEndpoint": "https://api.dev.local",
"featureFlags": ["new-ui", "beta-api"],
"debugMode": true
},
// Environment variable prefixes to include in context
"envPrefixes": ["MY_APP_", "API_"],
// Enable/disable git information collection
"includeGit": true,
// Sanitize file paths (replace home directory with ~)
"sanitizePaths": true
}
}
/*
Template Examples for MCP Server Configurations:
When context is enabled, you can use templates in your MCP server configurations:
{
"name": "project-aware-serena",
"command": "npx",
"args": [
"-y",
"serena",
"{project.path}", // Current working directory
"{project.name}", // Project name from context
"{project.environment}", // Environment from context
"{user.username}", // Current user
"{project.custom.apiEndpoint}", // Custom context variable
"{context.timestamp}" // Current timestamp
],
"env": {
"PROJECT_ID": "{project.custom.projectId}",
"USER_TEAM": "{project.custom.team}",
"GIT_BRANCH": "{project.git.branch?:main}",
"SESSION_ID": "{context.sessionId}"
}
}
Available Template Variables:
Project Context:
{project.path} - Current working directory
{project.name} - Project directory name
{project.environment} - Environment from context config
{project.git.branch} - Current git branch (if git repo)
{project.git.commit} - Current git commit (short hash)
{project.git.repository} - Git repository name
{project.custom.*} - Custom variables from context
User Context:
{user.username} - Current system username
{user.name} - User's display name
{user.email} - User's email (from git config)
{user.home} - User's home directory
Environment Context:
{environment.variables.*} - Environment variables
{context.path} - Alias for {project.path}
{context.timestamp} - Current ISO timestamp
{context.sessionId} - Unique session identifier
{context.version} - Context schema version
Template Functions:
{variable | upper} - Convert to uppercase
{variable | lower} - Convert to lowercase
{variable | capitalize} - Capitalize words
{variable | truncate(10)} - Truncate to length
{variable | replace(from,to)}- Replace text
{variable | basename} - Get filename from path
{variable | dirname} - Get directory from path
{variable | extname} - Get file extension
{variable | default(value)} - Default value if empty
Example: "{project.name | upper}-{context.timestamp | date('YYYY-MM-DD')}"
*/