Skip to content

Commit ee6a4a1

Browse files
author
Anivar Aravind
committed
Simplify identity implementation
Remove over-engineered features: - Remove identity show command - Remove test file - Simplify documentation - Keep only essential init functionality
1 parent fd3d4b3 commit ee6a4a1

File tree

2 files changed

+21
-27
lines changed

2 files changed

+21
-27
lines changed

cmd/identity.go

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ package cmd
22

33
import (
44
"fmt"
5+
"os"
6+
"path/filepath"
57

68
"github.com/hashicorp/go-hclog"
79
"github.com/spf13/cobra"
@@ -12,40 +14,17 @@ import (
1214
var identityCmd = &cobra.Command{
1315
Use: "identity",
1416
Short: "Manage MCP server identities",
15-
Long: `Manage AGNTCY-compliant identities for MCP servers.
16-
17-
Identity support is optional and disabled by default. Enable with:
18-
export MCPD_IDENTITY_ENABLED=true
19-
20-
Identities follow the AGNTCY Identity specification:
21-
https://spec.identity.agntcy.org/docs/id/definitions`,
2217
}
2318

2419
var identityInitCmd = &cobra.Command{
2520
Use: "init [server-name]",
2621
Short: "Initialize identity for an MCP server",
27-
Long: `Initialize an AGNTCY-compliant identity for an MCP server.
28-
29-
This creates a development identity with:
30-
- DID format: did:agntcy:dev:{organization}:{server}
31-
- ResolverMetadata with assertion methods
32-
- Service endpoints for MCP
33-
34-
The identity is stored in ~/.config/mcpd/identity/{server}.json`,
3522
Args: cobra.ExactArgs(1),
3623
RunE: func(cmd *cobra.Command, args []string) error {
3724
serverName := args[0]
3825
organization, _ := cmd.Flags().GetString("org")
3926

40-
// Create logger based on verbosity
4127
logger := hclog.NewNullLogger()
42-
if verbose, _ := cmd.Flags().GetBool("verbose"); verbose {
43-
logger = hclog.New(&hclog.LoggerOptions{
44-
Name: "identity",
45-
Level: hclog.Debug,
46-
})
47-
}
48-
4928
manager := identity.NewManager(logger)
5029
if err := manager.InitServer(serverName, organization); err != nil {
5130
return err
@@ -59,8 +38,5 @@ The identity is stored in ~/.config/mcpd/identity/{server}.json`,
5938
func init() {
6039
rootCmd.AddCommand(identityCmd)
6140
identityCmd.AddCommand(identityInitCmd)
62-
63-
// Flags for identity init
6441
identityInitCmd.Flags().StringP("org", "o", "mcpd", "Organization name for the identity")
65-
identityInitCmd.Flags().BoolP("verbose", "v", false, "Enable verbose logging")
6642
}

docs/identity.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,25 @@ Following [AGNTCY Identity Spec](https://spec.identity.agntcy.org/docs/id/defini
4848
}
4949
```
5050

51+
## Example Workflow
52+
53+
```bash
54+
# 1. Enable identity
55+
export MCPD_IDENTITY_ENABLED=true
56+
57+
# 2. Create identity for your server
58+
mcpd identity init github-server --org "AcmeCorp"
59+
60+
# 3. Start daemon - it will verify identity on startup
61+
mcpd daemon --dev
62+
# Look for: "Identity verified server=github-server"
63+
```
64+
5165
## Configuration
5266

5367
Identity is disabled by default. Enable with:
54-
- Environment variable: `MCPD_IDENTITY_ENABLED=true`
68+
- Environment variable: `MCPD_IDENTITY_ENABLED=true`
69+
70+
## Integration with .mcpd.toml
71+
72+
While identity configuration isn't in the TOML file yet, servers with identities are automatically verified on startup when identity is enabled.

0 commit comments

Comments
 (0)